javascript - Getting rid of the double click effect -
here's fiddle. can see i've defined simple click event handler:
$('#traveller > a').click(function(e) { e.preventdefault(); var $ul = $('#traveller ul'); if($(this).hasclass('handle-next')) { if(math.abs($ul.position().top - parentpadding) < totalheight - itemheight) { $ul.animate({top: '-=' + itemheight}); } } else { if($ul.position().top - parentpadding < 0) { $ul.animate({top: '+=' + itemheight}); } } });
i've noticed when make few double clicks quickly, pressing a.handle-next
/a.handle-prev
, ul
position changes unexpectedly.
howcome avoid behavior?
Comments
Post a Comment