Forum Moderators: open
<a href= "#" onClick="window.open('members/member.htm','Max', 'toolbar=no,width=320,height=400,left=500,top=200, screenX=500,screenY=200,status=no,scrollbars=no, resize=no');return false"><font size="2" face="Arial, Helvetica, sans-serif"><b>LINK</b></font></a>
I want something like this for the main site. I know I can create an index.htm with a link to the actual site to open in a new window, but I was wondering if you could put something in the <HEAD> to auto-resize the current window straight away?
Hope this makes sense lol. Thanks in advance.
I know it's tempting to use methods to make sure your site is seen at its best. And, what you want to know about can be done. But, it's normally not a good idea to change the visitor's browser window without some sort of choice on their end. Many people like their browser window just the way it is, others like to always browse at full screen, and others carefully size their browser window to a particular size to fit with other open windows/applications. This means that a good portion of people will be pretty upset if your site simply changes their browser window size without their approval. Not to mention which, Mozilla FireFox has features that prevent javascripts from resizing the browser window anyway, which is a choice I always turn on. So some visitors will see your site how they want to see it regardless of what tricks you use to resize it.
With that said, it is possible to do what you're suggesting. I don't know how myself, but if you're really set on doing this, you should try searching some of the script libraries, like javascriptsource.
Have you tried creating a fluid design, that will work and look good for all screen resolutions and sizes? That's really what many consider the best approach.
On the other hand, a window sized at 1000x1000 is going to be difficult to read, because of the scroll bars, at a resolution of 800x600.
Or users might want to view your site using a mobile phone.
Anyway, as MatthewHSE points out, users resize windows, etc if they don't like what they get. Go with his advice and use fluid design.
<SCRIPT LANGUAGE="JavaScript">
function Offer() {
props=window.open('http://www.website.com', 'Welcome', 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=1, width=800, height=600, left = 0, top = 0');
window.focus();
}
</script>
If you want a pop-up instead of a pop-under just remove the line:
window.focus();
If you want to close the original window and have just one window open you can use the me.close I think... little rusty on that so you might want to look it up.
Kimberly
<Sorry, no personal URLs. See TOS [webmasterworld.com]>
[edited by: tedster at 11:21 pm (utc) on June 25, 2004]