سؤال

I am using Jquery Draggable
My draggable is having four handles on all four sides viz (top, bottom, left and right) using which draggable can be dragged in respective direction

$('.draggable').draggable({
    handle: '.top, .bottom, .left, .right'
});

Well I can get the direction of drag and set the axis once the drag starts, but what if bottom handle is being used to drag to left direction.

So is there any way to know which handle is being used to drag a draggable?

هل كانت مفيدة؟

المحلول

Well I got an answer to my question, and I am posting it here so as to help others in future

$('. draggable').draggable({
    handle: '.top, .bottom, .left, .right'
    start : function(event, ui) 
    {
        console.log(event.originalEvent.target);
                 //OR
        console.log(event.originalEvent.originalEvent.explicitOriginalTarget);
    }
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top