PDA

View Full Version : Automatic Browser Resize



nohomedia
December 11th, 2005, 02:38 AM
I would like, when a page is opened up, for it to open up to a specifice size and not be able to be resized. Is there a way to specify in the html file what size the browser widow is supposed to be?

real_illusions
December 11th, 2005, 09:45 AM
well..whenever i come across a page that resizes itself..i always put it back to the way it was..or to a way which is easy for me.

to deny the user the ability to resize their browser is only going to turn visitors away, especially if its for the main site page.

if its for a javascript pop up window..then its not so bad in resizing.

i dont know how to do it..but thats my opinions on resizing anwyay.

JoshuaJonah
December 11th, 2005, 10:14 AM
i just scale all my movies so that they can make it smaller. Sure make it so that it comes up at a certain size, but dont limit resizing.

λ
December 11th, 2005, 10:16 AM
well..whenever i come across a page that resizes itself..i always put it back to the way it was..or to a way which is easy for me.

to deny the user the ability to resize their browser is only going to turn visitors away, especially if its for the main site page.

if its for a javascript pop up window..then its not so bad in resizing.

i dont know how to do it..but thats my opinions on resizing anwyay.

Word. Popups are √evil anyway ;)

nohomedia
December 12th, 2005, 02:21 AM
ok, maybe I need to explain. It's not for the main page, its going to be a pop-up window that will have a video of a certain size playing in it. I know how to size it with javascript so the popup will open to a certain size but they are going to be linking to this video from other sites as well and I can't put the javascript on other pages. Is there a way to put it in the code of the page itself so it comes up a certain size whether its a pop-up or an individual page. I guess I don't really care if it can be resized, I just want it to be a certain dimension anytime its accessed.

Ankou
December 12th, 2005, 01:58 PM
For the HTML window that you open include an onload in the body that calls a javascript function. That function can just resize the page to the size you need it.



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Resize</title>

<script type="text/javascript">
function resizeMe(){
window.resizeTo(500,500);
}
</script>

</head>
<body onload="resizeMe()">

Yup I'm a 500 by 500 window.

</body>
</html>

nohomedia
December 18th, 2005, 03:43 AM
Ok, that works great! One last thing, what would I add the the java script to control the attributes of the window. For example, take away the tool bar, address, status, scroll...etc?

nohomedia
December 26th, 2005, 10:17 PM
bump

Ankou
December 27th, 2005, 06:22 PM
For something like that you're going to have to work with window.open() in JavaScript. Thing is that I'm not sure that if the window is already open if you can change things like tool bar, address bar. I've never tried, but my guess is it wouldn't work.

What you would need to do is when the page loads, open a new window with the page and have the window use what you need it to have/don't need it to have (tool bar, address bar, status, etc). Then when that opens close the parent window.

Basically...

1. Have the window the user opens have a function in onload="" for the body tag. That function will open a new window (minus the tool bar, status bar, etc) and load the needed page. It'll also size the window.

2. That same function should try to close the window (not the new window).

You may have some problem with that because sometimes with browser settings closing a window that wasn't opened with Javascript will prompt the user with a warning.