Triggered while the mouse is moved during the dragging.
Parameters
Name | Type | Description |
---|---|---|
e | {object} | event data |
offset | {object} | Current offset position as { top, left } object. |
Examples
sample
<style>
.element { border: 1px solid #999; width: 300px; height: 200px; cursor: move; text-align: center; background-color: #DDD; }
</style>
<div id="element" class="element">
drag me
</div>
<script>
$('#element').draggable({
drag: function (e, offset) {
$('body').append('<div>The drag event is fired. offset { top:' + offset.top + ', left: ' + offset.left + '}.</div>');
}
});
</script>