PDA

View Full Version : resize window



flyingfish
10-13-2006, 09:29 PM
can someone help with script to resize window...

if i load a certain page, the same window resizes to a size of 600 pixels width x 300 pixels height

i dont want to open a new window...

also, if the user maximises the window... it shouldnt resize again

jscheuer1
10-14-2006, 08:10 AM
Control freak! Kidding aside, you cannot reliably do this so, find a better way to deal with the issue, like designing your page so that the size of the view-port is less important.

flyingfish
10-17-2006, 05:18 AM
stilll... the site is about an experimental project and any experiment is worth doing!!!

tech_support
10-17-2006, 06:30 AM
Code:


<script language="JavaScript" type="text/javascript">
self.resizeTo('600', '300')
</script>




also, if the user maximises the window... it shouldnt resize again

What do you mean? For the browser session? Pernamently?

sanjo
10-17-2006, 06:37 AM
Hope this helps...
Give ur details as needed. U can menetion ur size to open the page..

<script language="javascript">

function name()
{
var Url=(the page to open)
OpenWin = this.open(Url, "name of the window", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,dependent=no,directories=no,width=900,height=400,x=0,y=0");
}
</script>

tech_support
10-17-2006, 06:38 AM
He specifically said:

i dont want to open a new window...

jscheuer1
10-17-2006, 07:35 AM
stilll... the site is about an experimental project and any experiment is worth doing!!!

I think Hitler's Nazi doctors disproved that theory. As for another example, see:

http://en.wikipedia.org/wiki/Tuskegee_experiment

Anyways, this cannot be done reliably across browsers. In fact, your restrictions on not wanting to open a window and wanting to prevent the user from resizing their own window after you have resized it, make it impossible in any browser unless the user has no idea what they are doing. In which case, it is simply cruel.

djr33
10-17-2006, 08:13 AM
Ouch.
John, I don't think any lives are in danger here... just browsers. ;)

jscheuer1
10-17-2006, 08:22 AM
I admit they're extreme examples - what came to mind. Just because a thing can be done doesn't mean that it should be done and, in this case, it can't be done anyway.

flyingfish
10-17-2006, 09:13 AM
thanx, the code sort of serves the purpose...

when i said that


also, if the user maximises the window... it shouldnt resize again


i meant that after maximising, it should remain in a maximised state and should not resize once again to the size i have specified... so it will remain maximised and not resize to 600 x 300

this is only for the particular session... so i guess the code is alrite.

also is it seriously bad to resize the window? for an experimental art project??? i m not going to crash the system with it? am i???

well someone came up with the idea of popping up a new window and then everyone got popup blockers on their browsers and there are so many users who cant figure out why nothings happening on the website...

i am giving the flexibility, if the user wants to maximise or resize, he can

are we discussing ethics in a scripting forum...

thanx

tech_support
10-17-2006, 09:32 AM
also is it seriously bad to resize the window? for an experimental art project??? i m not going to crash the system with it? am i???

It won't crash the system, but it's just not right for the web. I guess it's ok for an experiment.

jscheuer1
10-18-2006, 08:54 AM
It's so hard to hit a moving target sometimes. However, no matter what it is for, it cannot be done reliably.