开发者

Connect draggable to sortable only if visible?

开发者 https://www.devze.com 2023-01-15 04:40 出处:网络
In the jquery ui docs for draggable, we can s开发者_高级运维pecify a sortable to connect to: $( \".selector\" ).draggable({ connectToSortable: \'ul#myList\' });

In the jquery ui docs for draggable, we can s开发者_高级运维pecify a sortable to connect to:

$( ".selector" ).draggable({ connectToSortable: 'ul#myList' });

is it possible to connect to a sortable only when its visibility is set to 'visible'? Something like:

$( ".selector" ).draggable({ connectToSortable: 'ul#myList:visibility=visible' });

I don't want to let the user drop elements on my sortable target unless it is visible,

Thanks


$( ".selector" ).draggable({ connectToSortable: '#myList:visible' });

Give it a shot and see if it works. :)

0

精彩评论

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