Jump to content
xisto Community
Amezis

Popup Window With Height And Width?

Recommended Posts

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 :P )Could someone give me a short code for that?

Share this post


Link to post
Share on other sites

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

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

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

The "popup 1" is width=300 and height=160
The "popup 1" is width=400 and height=300
The "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

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.