Jump to content


Photo

Opening A Window With A Set Size


  • Please log in to reply
1 reply to this topic

#1 RageSW

RageSW

    Administrator

  • RAGE Admin
  • PipPipPipPipPip
  • 2,082 posts

Posted 20 November 2005 - 09:48 PM

The following code will open a new window at a specified width and height.

Place the following javascript within your <HEAD> and <HEAD> tags.

<script type="text/javascript">
//<![CDATA[
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=yes,status=yes' );
}
//-->
//]]>
</script>


Now in your links using the following code to open another webpage in the new window. You can also point the first paramater to a picture to display a picture in this new window.

<a href="javascript:displayWindow('http://www.mylink.com',width,height)">Click Here to Open a New Window</a>

#2 Frank Blunt

Frank Blunt

    RAGE Newbie

  • RAGE Members
  • Pip
  • 2 posts

Posted 20 December 2005 - 08:07 PM

Is also nice to be able to close these windows using javascript too. The following does nicely:

<div id="closeWin">
<a href="javascript:window.close();">Close Window</a>
</div>

And if you're using CSS, you can use the div to position it exactly where you want it.

Have fun!

FrankB




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users