Log in

View Full Version : Making a new window with Javascript



Judas
02-04-2006, 03:29 PM
You can obviously make a pop up window with HTML in a link, but with Javascript you get to specify the dimensions of what the window will be.

In the code below, is an example. Where it says 'LINK HERE' in red, you place the adress in which clicking the link will take you to. Also in red, is the dimensions.

You can of course customize this, so if the link would take you to a flash movie you would have to make sure the dimensions were the right size for the best quality.


javascript:newWin=void(window.open('http://LINK HERE','newWin','width=100,height=100,top=60,left=6 0'))"

In the code below, the bit in blue would be the text displayed. So when it is clicked on it will go to the link. (The code is in HTML)


<A href='javascript:newWin=void(window.open('http://LINK HERE','newWin','width=100,height=100100,top=60,lef t=60'))">CLICK ME</A>

Pawf
02-04-2006, 03:46 PM
What I always use:


<a href="javascript:location='page to redirect to';window.open('page to open','characters','height=w/e,width=w/e,scrollbars=no')">Link</a>

Want to hide these adverts? Register an account for free!