user246114
user246114

Reputation: 51601

Connect draggable to sortable only if visible?

In the jquery ui docs for draggable, we can specify 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

Upvotes: 1

Views: 312

Answers (1)

xar
xar

Reputation: 1439

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

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

Upvotes: 2

Related Questions