调用draggabilly.pkgd.js
Draggabillly将添加类。#draggable被拖动的元素。
1 2 3 4 | var elem = document.querySelector( '#draggable' ); var draggie = new Draggabilly( elem, { // options... }); |
示例代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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 ; }); |
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com