Page 1 of 1

javascript

Posted: Fri Jul 16, 2010 12:39 am
by ansuriya
How do you make a page open in a specific height and width using javascript? I am building a web site and I want the first page by default to open up in a specific width and height. I konw how to open a new window in a specific height and width using javascript, but I dont know how to make the first page open up in a specific size. Is there any way to do this using Javascript?
__________________________
keyword research ~ keyword tool ~ keyword tracking ~ affiliate elite

Re: javascript

Posted: Thu Jul 29, 2010 2:41 pm
by Jade

Code: Select all

<script type="text/javascript">
function popup(url, width, height)
{
      window.open(url, "width=" + width + ", height=" + height);
}
</script>
<a href="popup('google.com', 500, 400)">Open a mini google window!</a>
There are additional options besides height and width. You can read about them here http://www.javascript-coder.com/window- ... open.phtml

Re: javascript

Posted: Sat Jul 31, 2010 7:51 pm
by Forumguru
The opening page url you are using is passed to the function when we call it, so that this function can be used for any number of different pop-ups though the height/width and other options will always be the same unless you modify the function to take more arguments. Some browsers prohibit the opening of pages on another server for security reasons. It is better to test your script again.