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=3Dfunction(e) {
e.setBubble(false);
var o=3De.getTarget();
if (!o.dragging){
o.dragging=3Dtrue;
o.moveTo(e.pageX-10,e.pageY-10);
o.dragging=3Dfalse;
}
}
so.. if the code from the previous call is still executeing =
(o.dragging=3Dtrue) 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=20
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
|