DraggabillyjQuery 拖放插件
Draggabilly 可帮你轻松实现网页上各种元素的拖放操作。支持 IE8+ 和多触摸。
示例代码:
var draggie = new Draggabilly( elem ); function onDragMove( instance, event, pointer ) { console.log( 'dragMove on ' + event.type + pointer.pageX + ', ' + pointer.pageY + ' position at ' + instance.position.x + ', ' + instance.position.y ); } // bind event listener draggie.on( 'dragMove', onDragMove ); // un-bind event listener draggie.off( 'dragMove', onDragMove ); // return true to trigger an event listener just once draggie.on( 'dragMove', function() { console.log('Draggabilly did move, just once'); return true; });
评论