AFAIK, "window.resizeTo(width, height);" is fairly cross-browser (it works for me in IE, NN, and FF at least).
Making this happen onclick would not be a good idea, IMHO - it would seriously annoy a lot of users every time they clicked (especially if they kept resizing their windows back to how they like it only to be resized by your code again... you know - personal preference, not like "all your windows are belong to us").
Dan
The answers you get are only as good as the information you give!
Hi Billy,
thanks for your answer.
To avoid the user the downside of the script wich efectively
proposes one an option to resize his window, once the window is resized, is there a function called on an onclick event to resize the window back to its original size.
Such as window size history go -1.
No - you'd have to put brackets after the function call:
Code:
<a href="#" onclick="resize[b]()[/b]"> ... </a>
And you'd also need to define "width" and "height".... although personally, I would strongly advise against using those as variable names. The only resaon I used "width" and "height" in my example was to show you what the paremeters were.
I would also avoid calling your function "resize", as there is already a method called "resize" in IE. Call it something like "myResize", etc.
Dan
The answers you get are only as good as the information you give!
If you resize only a child window while the parent is still active then the users browser will not be permanently reset. (as long as the child window is closed first of course)
I am using a single browser window so this could be possible
even if this window is the parent.
Any idea of a script that could restore the window to its initial size before it was resized
something like script.go -1.
I don't know if this is possible anyway, i mean to restore back any action done with javascript...
If you have any idea...
Well you would have to capture the original width and height and restore them when you are done but, as BillyRay said, users may find this irritating. If you must resize the browser window I would use the parent/child routine.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.