Gah!

I just realised the code I sent in my very first post to the list worked
just fine, and just like this, if I had wrapped java code passed in the
setTimeout argument with quotes!!!

James

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of James Head
Sent: Saturday, June 02, 2001 4:40 PM
To: [EMAIL PROTECTED]
Subject: RE: [Dynapi-Help] window.onresize


Aha!

your method works much better than mine, - which still occasionally executed
the code before stopping dragging.

your code minus the spelling mistakes :

<script language="JavaScript">
window.onresize = Resize
var ResID=null;
function Resize(){
    if  (ResID) clearTimeout(ResID);
    ResID = setTimeout('DoResize();',200);
}
function DoResize(){
        window.location.href = window.location.href
}
</script>

thanks a mill!

James


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Doug Melvin
Sent: Saturday, June 02, 2001 8:50 AM
To: [EMAIL PROTECTED]
Subject: Re: [Dynapi-Help] window.onresize


That is very simmilar to the method I was going to post today.
Congrats..

The main thing is that it works, right?

:-)

The other method is pre-emptive queueing..

window.onrisize = Resize();

var ResID=null;

function Resize(){
    if  (ResID) clearTimeout(ResID);
    ResID = setTimeout('DoResize();',200);
}

function DeResize(){
//    resizecode.
}

This will result in anly the LAST resize call being executed.


----- Original Message -----
From: "James Head" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 31, 2001 10:02 PM
Subject: RE: [Dynapi-Help] window.onresize


> I tried to implement your suggestion but couldn't get it working, but it
did
> inspire this :
>
>
> <script language="JavaScript">
>
> window.onresize = fixup;
>
> justResized = false;
>
> function fixup() {
> window.setTimeout("qrefresh()",200)
> }
>
> function qrefresh() {
>
> if (justResized == false) {
> window.location.href = window.location.href
> // (and any other code that will be hideous if executed every
> millisecond.)
> }
>
> justResized = true;
> // window will be considered to have been resized until...
> window.setTimeout("justResized = false;",200)
> }
>
> </script>
>
>
> which is doing exactly what I wanted!
>
> thanks for your help!
>
> James
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Doug Melvin
> Sent: Friday, June 01, 2001 12:42 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Dynapi-Help] window.onresize
>
>
> Again.
> You use event capping.
> The way this works is you create a global variable called resizing.
> At the start of your resize code you set: resizing = true
> At the end of your resize code you set: resizing = false
> At the VERY beggining of you resize code you put:
> if (resizing) return false;
>
>
> How this works:
> This is an "intelligent" fix as it will "adapt" to the speed of the
> computer+browser viewing it.
> What you are doing with thisd method, is preventing the browser from
reacing
> to EVERY resize event,
> and only handle at the rate at which it can,.
>
> Basically, you are discaring any resize events which occur while you are
> already reacing to resize code.
>
> You can use this method with any kind of event.
>
> IE: Dragging. I found using this method allowed my layer dragging to be
> almost as smooth on our Pentium 200mhz laptop
> as it was on my Duron 600mhz Dev box.
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 31, 2001 2:06 PM
> Subject: Re: [Dynapi-Help] window.onresize
>
>
> > I don't think this is possible, due to the fact that every pixel
increase
> or
> > decrease is concidered a resize event.. if you maximize or minimize the
> > window (instant resize) then it'll have the desired affect, otherwise I
> don't
> > think it's possible.. I'm sorry.. if anyone else knows a way t' do it..
> let
> > this poor chap know..
> >
> > -------
> > Vincent Calendo
> >
> > << Guys!
> >
> >  I'm trying to write a javascript that will execute an event after an IE
> user
> >  has finished resizing the window.  (That is to say, I'm trying to stop
> the
> >  event being executed every pixel the window is resized).
> >
> >  Any idea why this is failing miserably?  If anyone can think of a
> different
> >  approach I might take using different APIs, I'd appreciate that too.
> >
> >  The code below tries to set an event in the future every pixel the
window
> is
> >  resized, clearing out any old scheduled events as it does this.
> >
> >  <script language="JavaScript">
> >  window.onresize = fixup;
> >  timeoutID = null;
> >  function fixup() {
> >    window.clearTimeout(timeoutID)
> >    timeoutID = window.setTimeout(afterResize(), 200000)
> >  }
> >
> >  function afterResize() {
> >     alert('sdfds')
> >  }
> >
> >  </script>
> >
> >
> >
> >
> >  thanks
> >
> >  James >>
> >
> > _______________________________________________
> > Dynapi-Help mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/dynapi-help
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to