| | 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? |
|
|
This is the code:
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>
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!.
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?
The code modified for you.
CODE <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>
Great, but still a little thing: How can the different popups have different sizes?
The "popup 1" is width=400 and height=300 The "popup 1" is width=600 and height=10 CODE <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!
Could I do by this way?
CODE <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> ?
Similar Topics
Keywords : popup, window, height, width
(2) This is another refresh problem question. The project I'm doing uses tons of frames (I know, Table expands past screen at 100% (4) Hey everyone. I have been designing websites for a long time but i have recently decided to tryout how to set child height to be the same.. (2) I will try to explain myself as briefly as possible. I want have the next xhtml squeletone: CODE (13) Well, I have a table that I don't want to be over 350 pixels in width - even on the largest table width="100%" goes off screen (2) Hey everyone. My problem is that current i have a left menu and a right menu which are created using (3) How do I set a maximum table height? I tried height and max-height but neither worked. I need to (8) how do you add width and height to your page? without adding it to your link you previously Looking for popup, window, height, width
|
|
![]() Popup Window With Height And Width? |
| ADD REPLY / Got an Opinion! | Remove these ADs! | RAPID SEARCH! | Free Web Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute more info. to help others. Ask your Doubts & Queries to get answers, So that "Together We can help others!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|