Problem resizing the window

N

Nabil Benamar

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

Randy Webb

Nabil said:
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.
 
I

Ivo

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
 

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
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top