Welcome to WebmasterWorld Guest from 54.161.108.158

Forum Moderators: open

Message Too Old, No Replies

javascript for popup window

     
11:58 pm on Mar 13, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 10, 2000
posts:2151
votes: 0


I need a javascript for a popup window but the only ones I can find only allow for one size of window. I need a script that passes the size parameter when you click the link. I'm having thumbnails enlarge into popup windows on click and not all the images are the same size.
12:12 am on Mar 14, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


Oil, a couple of us were hacking away on this in another thread, trying to get the simplest code. Here's the result:

1) For the .js file or the HEAD section

function cPop(url, wide, high) {window.open(url,"popup",'width=' + wide + ',height=' + high);
}

2) Link code for the body:

<a href="javascript:cPop('pagename.html',www,hhh)">Link</a>

Edited by: tedster

12:14 am on Mar 14, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 10, 2000
posts:2151
votes: 0


tedster - you rock! Perfect.

kat

5:30 am on Mar 14, 2001 (gmt 0)

Inactive Member
Account Expired

 
 


you guys rock.. that was just the same question i was going to ask...as i need that popup window to be a specific size... but i see ya beat me to it!! thanks for the help anywayz..! :)