PDA

View Full Version : Javascript Pop-up window


Atian
03-27-2002, 01:37 PM
Ok, here is a JavaScript that will popup a window. And a button or link for the window to open or close.
==============================================
Place this part anywhere in the <HEAD></HEAD> part of your HTML document.
==============================================
<script language="JavaScript">
<!-- Hide from old browsers
function popwin(){
window.open("your.htm","","PLACE VALUES HERE*")
}
//--> End of Script
</script>
==============================================
Here you specify the values of your window and you'll put them within the quotes in the PLACE VALUES HERE part.

height=(x # of pixels high)
width=(x # of pixels wide)
toolbars=1 (yes), 0 (no)
scrollbars= " "
resizable= " "
fullscreen = " " **
top=(x # of pixels from the top)
left=(x # of pixels from the left)

**if you use fullscreen, then you cannot use height,width,resizable,top, and left.

If you omit any data values, it is an understood no. so leavong out the resizable value means it will default to no resizable.
==============================================
Place this anywhere in the <BODY></BODY> tags
==============================================
<FORM>
<INPUT TYPE="button" onClick="popwin()" VALUE="OPEN WIN">
</FORM>
<A HREF="javascriptopwin()">OPEN A POPUP HERE!</A>
==============================================
Put this in the <BODY></BODY> tags of the popup
==============================================
<FORM>
<INPUT TYPE="button" value="CLOSE ME!" onClick="window.close()">
</FORM>
<A HREF="javascript:window.close()">Close Window</A>
==============================================
The first group will make a button and a text link which will open your popup window.

The second group makes a button and text link which close your window.

Simple, huh?

MrLister
03-27-2002, 01:40 PM
Another template. You should post this stuff in the template area rather then hacks.

fonzerelli_79
03-27-2002, 04:09 PM
whats the deal Atian??

did you swallow a java script book or something!!

Floris
03-27-2002, 05:53 PM
Sorry to flame you, but I do not really see what this has to do with hacking vBulletin source code ..

nafae
03-27-2002, 06:30 PM
I think it has to do with "Getting a high hack count of some sort" the newest evolution of the dreaded "spam to get a higher post count" lol.

Neo
03-28-2002, 01:54 AM
Indeed.

Admin
03-28-2002, 08:35 AM
*stats a Javscript forum just for Atian* :)

Ok, everyone calm down, I think he was just a little bit confused and hopefully he got the point. :)