homepage Welcome to WebmasterWorld Guest from 54.205.241.107
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
javascript for popup window
oilman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 277 posted 11:58 pm on Mar 13, 2001 (gmt 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.

 

tedster

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



 
Msg#: 277 posted 12:12 am on Mar 14, 2001 (gmt 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

oilman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 277 posted 12:14 am on Mar 14, 2001 (gmt 0)

tedster - you rock! Perfect.

kat

10+ Year Member



 
Msg#: 277 posted 5:30 am on Mar 14, 2001 (gmt 0)

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..! :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved