PDA

View Full Version : a little assistance please



LindenJ
09-04-2004, 06:55 PM
hello, i have a button that opens a new page full screen but i would like the button to also close the first window whilst it still opens the new window, please can you tell me how to do this, i tried this already

<form>
<input type="button" onClick="window.close(),fullwin('link goes here')" value="ENTER HERE"> </p>
</form>

it seems to work when its on my pc, but as soon as i upload it, it wont work, what am i doing wrong, or is there another way :confused:

LJ

cr3ative
09-04-2004, 07:10 PM
Hi LJ,

Use this code instead, it works fine in IExplorer.




<script>
function go() {
window.close();
window.open("http://www.website.com", '', 'fullscreen=yes, menubar=1, toolbar=1, scrollbars=1');
}
</script>

<input type="button" onClick="go();" value="ENTER HERE"> </p>



This script should work for all javascript browsers. Replace website.com with your desired target page.

Here's a description of different variables you can use to customize a new window. Put these if required where the variables menubar=1 etc are, separate them with a comma.

width (number) = The width of the new window in pixels
height (number) = The height of the new window in pixels
left (number) = The location where the left side of the window should appear
top (number) = The location where the top of the window should appear
location (yes/no) = Controls whether the browser should display the browser r
menubar (yes/no) = Controls whether the browser should display the menu bar
resizable (yes/no) = Allows the user to resize the browser window
scrollbars (yes/no) = Controls whether horizontal or vertical scrollbars are shown
status (yes/no) = Controls the display of the status bar (the area at the bottom of the browser)
toolbar (yes/no) = Controls whether the browser should display the toolbar that contains the back/forward/etc buttons
fullscreen (yes/no) = If yes, opens the window to the full size of the screen. [IE 4+ only]

Hope this helps
cr3ative