これが私のフィドルです。ご覧のとおり、単純なクリックイベント ハンドラーを定義しました。
$('#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});
}
}
});
/を押してダブルクリックを数回すばやく行うと、位置が予期せず変更されることに気付きました。a.handle-next
a.handle-prev
ul
どうすればこの動作を回避できますか?