用法:
drag( event, ui )
類型:drag
在拖動期間移動鼠標時觸發,即在當前移動發生之前。
代碼示例:
使用指定的拖動回調初始化可拖動對象:
$( ".selector" ).draggable({
drag: function( event, ui ) {}
});
將事件偵聽器綁定到拖動事件:
$( ".selector" ).on( "drag", function( event, ui ) {} );
通過 ui.position
約束移動:
$( ".selector" ).draggable({
drag: function( event, ui ) {
// Keep the left edge of the element
// at least 100 pixels from the container
ui.position.left = Math.min( 100, ui.position.left );
}
});
相關用法
- JQuery UI Draggable disabled用法及代碼示例
- JQuery UI Draggable destroy用法及代碼示例
- JQuery UI Draggable disable用法及代碼示例
- JQuery UI Draggable delay用法及代碼示例
- JQuery UI Draggable distance用法及代碼示例
- JQuery UI Draggable snapMode用法及代碼示例
- JQuery UI Draggable snap用法及代碼示例
- JQuery UI Draggable start( event, ui )用法及代碼示例
- JQuery UI Draggable cursorAt用法及代碼示例
- JQuery UI Draggable containment用法及代碼示例
- JQuery UI Draggable snapTolerance用法及代碼示例
- JQuery UI Draggable option用法及代碼示例
- JQuery UI Draggable stop( event, ui )用法及代碼示例
- JQuery UI Draggable revertDuration用法及代碼示例
- JQuery UI Draggable iframeFix用法及代碼示例
- JQuery UI Draggable enable用法及代碼示例
- JQuery UI Draggable cursor用法及代碼示例
- JQuery UI Draggable scrollSensitivity用法及代碼示例
- JQuery UI Draggable axis用法及代碼示例
- JQuery UI Draggable scrollSpeed用法及代碼示例
- JQuery UI Draggable appendTo用法及代碼示例
- JQuery UI Draggable zIndex用法及代碼示例
- JQuery UI Draggable scroll用法及代碼示例
- JQuery UI Draggable addClasses用法及代碼示例
- JQuery UI Draggable connectToSortable用法及代碼示例
注:本文由純淨天空篩選整理自jqueryui.com大神的英文原創作品 Draggable drag( event, ui )。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。