Problem resizing the window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nabil Benamar

    Problem resizing the window

    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.


  • Randy Webb

    #2
    Re: Problem resizing the window

    Nabil Benamar wrote:[color=blue]
    > 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.
    >
    >[/color]
    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.javas cript FAQ - http://jibbering.com/faq/

    Comment

    • Ivo

      #3
      Re: Problem resizing the window

      "Nabil Benamar" wrote[color=blue]
      > 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.[/color]

      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=unf lag;
      onmouseup=trigg er;

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

      HTH
      Ivo


      Comment

      Working...