Reply
How to set popup's parameters?
Old 08-06-2004, 10:33 AM How to set popup's parameters?
Junior Talker

Posts: 3
Hello, there is my code:
var newwindow;
function open_popup(url)
{
newwindow=window.open(url,'name','height=400,width =200,left=100,right=200');
if (window.focus) {newwindow.focus()}
}


<a href="javascriptpen_popup('mypopup.html');">Pop it</a>

How to modify this script to be able to supply url, dimensions and position as function arguments (not only url as is now)? I mean function which looks like this: open_popup(url,width,height,left,top). Is it possible?

Thanks!
Vukas is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-06-2004, 02:07 PM
webwoRRks's Avatar
Ultra Talker

Posts: 426
Location: I hope so
function open_popup(url,nWidth,nHeight,nLeft,nTop) {
newwindow = window.open(url,'name','height='+nHeight+',width=' +nWidth+',left='+nLeft+',top='+nTop);
if(window.focus) { newwindow.focus(); }
}
webwoRRks is offline
Reply With Quote
View Public Profile Visit webwoRRks's homepage!
 
Reply     « Reply to How to set popup's parameters?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11419 seconds with 12 queries