If you choose the second option Ryan proposed, there is an undocumented 'delay' option that may come in handy. Without it, if the mouse moves so much as a pixel between mousedown/mouseup (not uncommon), it will trigger as a drag. If you add a delay between 200-400 ms, the difference will not be noticeable when a drag is attempted, but won't foul up a click attempt.
(I'll add 'delay' to the Draggable docs this week.) TAG On Nov 24, 2006, at 8:42 AM, Ryan Gahl wrote: > 2 possibilities: 1) Use a handle for the dragging that is not your > link, or 2) use mousedown/up with a "wasDragged" flag instead of > onclick event handler for your link. (when mousedown happens, set > wasDragged false, onDrag set it true, if mouseup happens and > wasDragged still == false, treat as click) > > Other than that, good luck. > > On 11/24/06, opetznick <[EMAIL PROTECTED]> wrote: > > Hi > > I'm searching for a solution to make a draggable also a link. I found > no solution yet without creating a not nice hack. i tried to check if > i'm onclick on the element or not and then fire the return true or not > for a anchor. next thing which i would do but not like to do is to set > a timeout. > > so someone got it working? would be nice if someone could share the > code. > > thanks in advance, oliver > > > > Athena Group, Inc. > Inquire: 1-920-955-1457 > Blog: http://www.someElement.com > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
