By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,569 Members | 1,181 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,569 IT Pros & Developers. It's quick & easy.

forcing refresh upon resize

P: n/a
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

Oct 8 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
la***********@zipmail.com wrote:
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?

--
Vladdy
http://www.klproductions.com
Oct 8 '05 #2

P: n/a
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
:)

Oct 8 '05 #3

P: n/a
<la***********@zipmail.com> wrote in message news:11**********************@g14g2000cwa.googlegr oups.com...
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;
}
Oct 8 '05 #4

P: n/a
la***********@zipmail.com 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
--
remove blah to email me
Oct 8 '05 #5

P: n/a
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 8 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.