On Jan 28, 4:53 am, "pixeline" <[EMAIL PROTECTED]> wrote:
> Hello!
>
> Short version :
> I need a tip on the right way to make repetitive calls to a function
> on mouseDown. mouseUp should make this repetitive call stop.
When the mousedown event occurs, add a mousemove event handler. When
mouseup occurs, remove it. The mousemove handler looks at the event
object to discover where the cursor is now compared to where it was
last time the event was called and does stuff accordingly.
Some browsers seem to call mousemove based on time, others on
movement. A good cross-browser solution takes a lot of time and
effort. There are many "draggable" libraries that use this method,
including Scriptaculous:
<URL: http://wiki.script.aculo.us/scriptaculous/show/Draggables >
Some comparison libraries:
YAHOO! - big and full-featured
<URL: http://developer.yahoo.com/yui/dragdrop/ >
FORK - minimalist but functional:
<URL: http://forkjavascript.org/drag/tests >
WalterZorn - detailed, specific to dragging and dropping:
<URL: http://www.walterzorn.com/dragdrop/dragdrop_e.htm >
--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---