Amezis 0 Report post Posted June 9, 2005 I will try to explain:When clicking on the link, a pop-up window will be opened. I also want to have the width=300 and height=160 (just examples )Could someone give me a short code for that? Share this post Link to post Share on other sites
DoR 0 Report post Posted June 9, 2005 This is the code: <html><head><script>function popup(){window.open('URL','window_name','width=300,height=160,scrollbar=1');}</script></head><body><a href='javascript:popup()'>popup!!</a></body></html> Share this post Link to post Share on other sites
Amezis 0 Report post Posted June 9, 2005 Thank you.But if I want more than one different popup, how can I do that? Share this post Link to post Share on other sites
DoR 0 Report post Posted June 9, 2005 To open more than one popup, with one link, just copy inside the function popup(), the line window.open and use diferent window names.Thats all.If I that was usefull, vote me!. Share this post Link to post Share on other sites
Amezis 0 Report post Posted June 9, 2005 No, no... Not with one link. If I have [link 1] which opens popup 1, and [link 2] which opens popup 2... How can I do that? Share this post Link to post Share on other sites
DoR 0 Report post Posted June 9, 2005 The code modified for you. <html><head><script>function popup(link,window_name){window.open(link,window_name,'width=300,height=160,scrollbar=1');}</script></head><body><a href='javascript:popup("URL1","window1")'>popup 1</a><br><a href='javascript:popup("URL2","window2")'>popup 2</a><br><a href='javascript:popup("URL3","window3")'>popup 3</a><!-- And so on... --></body></html> Share this post Link to post Share on other sites
Amezis 0 Report post Posted June 9, 2005 Great, but still a little thing: How can the different popups have different sizes? Share this post Link to post Share on other sites
DoR 0 Report post Posted June 10, 2005 The "popup 1" is width=300 and height=160The "popup 1" is width=400 and height=300The "popup 1" is width=600 and height=10 <html><head><script>function popup(link,window_name,width,height){window.open(link,window_name,'width='+width+',height='+height+',scrollbar=1');}</script></head><body><a href='javascript:popup("URL1","window1",300,160)'>popup 1</a><br><a href='javascript:popup("URL2","window2",400,300)'>popup 2</a><br><a href='javascript:popup("URL3","window3",600,10)'>popup 3</a><!-- And so on... --></body></html> ______________________________If that was usefull, vote me! Share this post Link to post Share on other sites
FaLgoR 0 Report post Posted June 10, 2005 Could I do by this way? <html><head><script>function popup(){window.open('URL','window_name','width=300,height=160,scrollbar=1');}function popup2(){window.open('URL','window_name','width=300,height=160,scrollbar=1');}</script></head><body><a href='javascript:popup()'>popup!!</a><a href='javascript:popup()'>another popup!!</a></body></html> ? Share this post Link to post Share on other sites
Amezis 0 Report post Posted June 11, 2005 Thank you! Both of the codes are working Share this post Link to post Share on other sites
iGuest 3 Report post Posted November 10, 2009 Height And Width of Window in JavascriptPopup Window With Height And Width?What is request height and width of window when "window.Onresize()"?-reply by Nguyen Tien Long Share this post Link to post Share on other sites