Special events extensions add a set of special events plugins.
The $.Drag
and $.Drop
plugins contain the drag and drop events.
Let's paste the following code into the jquerymx_draganddrop.js
file:
steal( 'jquery/event/drag', 'jquery/event/drag/limit', 'jquery/event/drag/scroll', 'jquery/event/drag/step', 'jquery/event/drop', function ($) { $('body').append('<p>Drag me, but not too far...</p>'), $('p').bind('dragmove', function (e, drag) { if (drag.location.top() > 150 || drag.location.left() > 450) { console.log('limiter'), e.preventDefault(); } }); } );
18.216.44.143