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

Problem resizing the window

P: n/a
Hi,
can someone help me please.
I want to reload th page after resizing the window (Browser). I used the
event onresize.
The problem the server gets too many requests (on every resize: pixel by
pixel).
window.onresize = myfunction();
What can I do to reload the page only after releasing the mouse.
Thanks.
Nabil Benamar.
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Nabil Benamar wrote:
Hi,
can someone help me please.
I want to reload th page after resizing the window (Browser). I used the
event onresize.
The problem the server gets too many requests (on every resize: pixel by
pixel).
window.onresize = myfunction();
What can I do to reload the page only after releasing the mouse.
Thanks.
Nabil Benamar.

Use settimeout to wait 3 seconds or so after resize, then reload the
page. It will set a timeout for every single pixel it gets resized but
once the page gets reloaded, the ensuing timeouts will be gone.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #2

P: n/a
Ivo
"Nabil Benamar" wrote
I want to reload th page after resizing the window (Browser). I used the
event onresize.
The problem the server gets too many requests (on every resize: pixel by
pixel).
window.onresize = myfunction();
What can I do to reload the page only after releasing the mouse.


What is the reason for the reloading? I can't think of one which would be
necessary, certainly not in "all" browsers. Nevertheless, an idea:

var globalvar=false;
onresize=flag;
onmousedown=unflag;
onmouseup=trigger;

function flag(){ globalvar=true; }
function unflag(){ globalvar=false; }
function trigger(){ if(globalvar==true) doyourthing(); }

HTH
Ivo
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.