Connecting Tech Pros Worldwide Forums | Help | Site Map

forcing refresh upon resize

laredotornado@zipmail.com
Guest
 
Posts: n/a
#1: Oct 8 '05
Hello,
When the user resizes the browser (either by clicking on the lower
right or clicking the button at the upper left to maximize screen
dimensions or not), how do I catch that event and then automatically
issue a browser refresh? Ideally, this solution should work for both
IE and Firefox.

Thanks, - Dave


Vladdy
Guest
 
Posts: n/a
#2: Oct 8 '05

re: forcing refresh upon resize


laredotornado@zipmail.com wrote:[color=blue]
> Hello,
> When the user resizes the browser (either by clicking on the lower
> right or clicking the button at the upper left to maximize screen
> dimensions or not), how do I catch that event and then automatically
> issue a browser refresh? Ideally, this solution should work for both
> IE and Firefox.
>
> Thanks, - Dave
>[/color]
Just out of curiosity, why would you want to annoy your visitors with
something like that?

--
Vladdy
http://www.klproductions.com
Robert Mark Bram
Guest
 
Posts: n/a
#3: Oct 8 '05

re: forcing refresh upon resize


Hi Dave,

Try something like this:
//Get window's current onResize handler(s)
var oldWindowOnResizeHandler =
(window.onresize) ? window.onresize : function () {};
//Add your own onResize Handers to that
window.onresize = function () {
oldWindowOnResizeHandler();
// do your thing here
};


Rob
:)

Stephen Chalmers
Guest
 
Posts: n/a
#4: Oct 8 '05

re: forcing refresh upon resize


<laredotornado@zipmail.com> wrote in message news:1128739967.030338.284880@g14g2000cwa.googlegr oups.com...[color=blue]
> Hello,
> When the user resizes the browser (either by clicking on the lower
> right or clicking the button at the upper left to maximize screen
> dimensions or not), how do I catch that event and then automatically
> issue a browser refresh? Ideally, this solution should work for both
> IE and Firefox.
>
> Thanks, - Dave
>[/color]
window.onresize=function()
{
window.onresize=null;

if(confirm('The author of this page considers it desirable that it be re-loaded on the occasion of its re-sizing.\n\nTo
authorise this, click [OK]'))
document.location=document.location;
}


Gérard Talbot
Guest
 
Posts: n/a
#5: Oct 8 '05

re: forcing refresh upon resize


laredotornado@zipmail.com a écrit :[color=blue]
> Hello,
> When the user resizes the browser (either by clicking on the lower
> right or clicking the button at the upper left to maximize screen
> dimensions or not), how do I catch that event and then automatically
> issue a browser refresh? Ideally, this solution should work for both
> IE and Firefox.
>
> Thanks, - Dave
>[/color]

Browsers do a redraw of the page when a resize event is fired on the
window object. So the natural, normal question to ask is why would you
need to do a refresh anyway?

Gérard
--
remove blah to email me
Randy Webb
Guest
 
Posts: n/a
#6: Oct 8 '05

re: forcing refresh upon resize


Robert Mark Bram said the following on 10/7/2005 11:37 PM:

This is Usenet, not Email. Please quote what you are replying to, it
makes the thread easier to follow.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.
[color=blue]
> Hi Dave,
>
> Try something like this:
> //Get window's current onResize handler(s)
> var oldWindowOnResizeHandler =
> (window.onresize) ? window.onresize : function () {};
> //Add your own onResize Handers to that
> window.onresize = function () {
> oldWindowOnResizeHandler();
> // do your thing here
> };[/color]

Why the empty function if window.onresize is not defined? Seems like
overkill.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Closed Thread