forcing refresh upon resize

L

laredotornado

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
 
V

Vladdy

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
Just out of curiosity, why would you want to annoy your visitors with
something like that?
 
R

Robert Mark Bram

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
:)
 
S

Stephen Chalmers

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
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

Gérard Talbot

(e-mail address removed) a écrit :
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

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
 
R

Randy Webb

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.
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
};

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top