Hi All I have a sortable <ul> list where each <li> contains a link. e.g. <ul> <li><a>link</a></li> <li><a>link</a></li> <li><a>link</a></li> </ul> How can I go about stopping the click event on the link if the li element has been dragged? Cheers Rob
<jim.kennedy-Lr/lmMrs2ylWk0Htik3J/w@public.gmane.org>
2006-Mar-16 11:40 UTC
RE: how to distinguish between click and drag?
Onmouseup / onmousedown / onclick / onmousemove events? Jim. -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Rob Clayburn Sent: 16 March 2006 00:04 To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails-spinoffs] how to distinguish between click and drag? Hi All I have a sortable <ul> list where each <li> contains a link. e.g. <ul> <li><a>link</a></li> <li><a>link</a></li> <li><a>link</a></li> </ul> How can I go about stopping the click event on the link if the li element has been dragged? Cheers Rob _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
> Onmouseup / onmousedown / onclick / onmousemove events? > > > Jim. > > >Sorry I wasn''t clear! If I drag the <li> by clicking on the <a> the <a>''s onclick is fired as well as the <li>''s drag. What I want is for the <a> click event to be fired ONLY if the <li> is not dragged. So, I guess I need to call an Event.stop(e) from the sortables''s onUpdate function, which will stop the <a> onclick from occuring. However, the onUpdate function only passes you the element that was updated - not the event associated with it. Cheers rob
Reasonably Related Threads
- Sortable > how to know wich elementID was dropped ?
- How to achieve the 'multi' fade effect that is used by Apple computer?
- cancelling droppable if draggable dropped on different droppable
- "Cannot convert String to Integer" after using association
- Howto disable Firefox Drag + Drop