anyone know the javascript for a pop up window?
Javascript for a pop up windowanyone know
Page 1 of 1
2 Replies - 1442 Views - Last Post: 27 April 2002 - 07:01 AM
Replies To: Javascript for a pop up window
#2
Re: Javascript for a pop up window
Posted 27 April 2002 - 01:22 AM
#3
Re: Javascript for a pop up window
Posted 27 April 2002 - 07:01 AM
that will (probably) spit out a huge amount of unnecessary code, including features you *might* not use. here ya go:
now to use this function, on the <a> link you want to open the window, use this code: <a href="#" onclick="openWindow('http://litescript.ekostudios.com','thisWindow','menubar=no,scrollbars=no');">the link</a>
there are many possibilities ;) thats what makes JS great! :biggrin:
<script language="javascript" type="text/javascript">
function openWindow(url,name,features) {
myWin = window.open(url, name, features);
}
</script>
now to use this function, on the <a> link you want to open the window, use this code: <a href="#" onclick="openWindow('http://litescript.ekostudios.com','thisWindow','menubar=no,scrollbars=no');">the link</a>
and there you go :) you can add features like fullscreen=yes, etc. there are MANY MANY features. I tested the code, it works great, and is very simple :) hope i helped you out, bro! :biggrin:
Digit: not trying to degrade you here, I just am majorly against un-needed extra code, which is what those kind of sites spit out (usually) :)
-pete
PS: if you want to modify that window later, you can use the name that you gave it before the window.open() command. like this:
myWin.resizeTo(0,0); -or- myWin.moveTo(43,290);
there are many possibilities ;) thats what makes JS great! :biggrin:
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote




|