|
I have seen a lot of question latly which should be
cleared up with the following.
I found that when dragging my toolbar on a slower
machine that eveerything got VERY choppy.
So I applied and old Visual Basic fix and
everything smothed out.
The premis of the fix is that an event can be
called while the code of the same event is still executing from the last
call.
So here is what I did.
In the tool bar I added a property called
dragging.
this is treated as a boolean switch and is used as
shown below:
l.ondragmove=function(e)
{
e.setBubble(false); var o=e.getTarget(); if (!o.dragging){ o.dragging=true; o.moveTo(e.pageX-10,e.pageY-10); o.dragging=false; } } so.. if the code from the previous call is
still executeing (o.dragging=true) then don't try to execute the code
again.
This has made the dragging of my toolbar MUCH more
smoother, and I believe that such a
switch can be used to clear up MANY similar
event-based problems..
Such as in a resize event, or a mousemove
event.
Later.
Doug Melvin
|
- [Dynapi-Dev] [Dynapi-Dev] Doug Melvin
- [Dynapi-Dev] [Dynapi-Dev] Raymond Smith
