Javascript 拖动后检测鼠标
我有jqueryuiJavascript 拖动后检测鼠标,javascript,jquery,jquery-ui,Javascript,Jquery,Jquery Ui,我有jqueryuidraggable处理一个元素 当拖动elementA时,我正在从elementB中删除一个类 我希望在elementA停止拖动时检测,并将类添加回elementB $('.container').draggable({ // Output offset while dragging box drag: function(){ $('.properties').removeClass('appear'); // Detec
draggable
处理一个元素
当拖动elementA
时,我正在从elementB
中删除一个类
我希望在elementA
停止拖动时检测,并将类添加回elementB
$('.container').draggable({
// Output offset while dragging box
drag: function(){
$('.properties').removeClass('appear');
// Detect mouseup after dragging has stopped
// and add .appear back to .properties
}
});
使用停止:
$('.container').draggable({
// Output offset while dragging box
drag: function(){
$('.properties').removeClass('appear');
// Detect mouseup after dragging has stopped
// and add .appear back to .properties
},
stop: function() {
// Add your class back to elementB here.
$('.properties').addClass('appear');
}
});
阅读有关jQuery UI示例中的stop
和可拖动事件的更多信息:使用stop
:
$('.container').draggable({
// Output offset while dragging box
drag: function(){
$('.properties').removeClass('appear');
// Detect mouseup after dragging has stopped
// and add .appear back to .properties
},
stop: function() {
// Add your class back to elementB here.
$('.properties').addClass('appear');
}
});
阅读jQuery UI示例中有关停止和可拖动事件的更多信息: