Triggered when dragging starts.
Parameters
Name | Type | Description |
---|---|---|
e | {object} | event data |
mousePosition | {object} | Current mouse position as { x, y } 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 gj-unselectable">
drag me
</div>
<script>
$('#element').draggable({
start: function (e, mousePosition) {
$('body').append('<div>The start event is fired. mousePosition { x:' + mousePosition.x + ', y: ' + mousePosition.y + '}.</div>');
}
});
</script>