开发者

jQuery sortable -- enable sortable only on drag, not click

I have a bunch of divs which have jQuery sortable (as grid) enabled. This is all working fine, but I want to only have sortable enabled when a user drags the div - not when he clicks it. For example, these divs have scrollbars, and whenever you drag the handle, it binds the div to the mouse and forces you to sort it. How do I turn this off?

Here's my jQuery:

$(  "#sortable"  ).sortable({ items: 'li:not(.ui-tabs-nav-item,#newspod,#imglist li)', containment: '#sortable'})

$( "开发者_JAVA百科#sortable" ).disableSelection();


You can add this property

distance: 15

to your sortable object so that the user has to drag it 15 pixels before it will activate the sortable behavior.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜