jQuery UI:开始拖动之前 [英] jQuery UI : Before start draggable
本文介绍了jQuery UI:开始拖动之前的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案如何实现一个before start事件来改变在jQueryUI开始拖动之前可以拖动的元素的DOM中的位置和位置?方案
您可以扩展原型方法:
var oldMouseStart = $ .ui.draggable.prototype._mouseStart;
$ .ui.draggable.prototype._mouseStart = function(event,overrideHandle,noActivation){
this._trigger(beforeStart,event,this._uiHash());
oldMouseStart.apply(this,[event,overrideHandle,noActivation]);
};
$(#draggable)。draggable({
beforeStart:function(){
console.log('beforeStart ::');
}
});
How to implement a before start event to have a change to change the position and place in the DOM of the draggable element before jQueryUI start to drag?
解决方案
You could extent prototype method:
var oldMouseStart = $.ui.draggable.prototype._mouseStart;
$.ui.draggable.prototype._mouseStart = function (event, overrideHandle, noActivation) {
this._trigger("beforeStart", event, this._uiHash());
oldMouseStart.apply(this, [event, overrideHandle, noActivation]);
};
$("#draggable").draggable({
beforeStart: function () {
console.log('beforeStart::');
}
});
这篇关于jQuery UI:开始拖动之前的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文