[Javascript] Moving elements

David Lovering dlovering at gazos.com
Tue Apr 1 16:44:43 CST 2003


Pardon me for being a dummy, but where on your site do the coding examples
you cite actually live?

[P.S:  I don't believe in "API Development Tools" either.  Every one I've
ever seen is riddled with bugs and incompatibilities, and the learning curve
is so steep you never catch up with what the "contemporary" package looks
like.  I'm from the OLD days, when men were men, and sheep ran scared, and
programming required chipping the 1's and 0's out of granite with your bare
hands.]

-- Dave Lovering

----- Original Message -----
From: "Andrew Gibson" <andyg at ihug.co.nz>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Tuesday, April 01, 2003 1:26 PM
Subject: Re: [Javascript] Moving elements


> >>>>>>
> The most gruesome part (for either Netscape or IE) is to build the
> eventHandler
> routines for the mouseDown, mouseUp, and drag events, and tie them to
> incremental
> offset changes made to the position of the layer's reference corner.  To
> avoid
> overflowing the eventHandler cache, you have to 'debounce' the mouse
> movements
> by polling the mouse position every 50 to 100 msec or so (using
setTimeout),
> but
> only during the 'drag' stage of the mouse transit.
> >>>>>>
>
> I just used the onmousemove event and then had the script calculate the
> mouse position using
> window.event.clientX  and window.event.clientY then move the element
during
> the move. But at the start when you move the element the cursor jumps to
the
> corner of the element, so you have to do an initial offset calculation to
> fix that.
>
> As David says, there are further tricky bits like identifying when to stop
> the drag, where to drop the item etc etc.
>
> I think theres a sample here on my site
>
> www.dscript.net.nz
>
> then select display, dragging
>
> But couldn't get it working smoothly in NS , mind you that was a year or
so
> ago.
>
> Andrew Gibson
>
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>




More information about the Javascript mailing list