开发者

jquery droppable accept condition

How can i put a second accept condition for a droppable element in jquery ?

accept: ":not(.ui-sortable-开发者_如何学Gohelper)",
accept: function() {
if($("#playlist li").length <=<?php echo $max_item; ?>) return    true;              
},

This don't work

Thanks


Using a function is more flexible than using a selector - since it allows to do the same. I would put the whole condition in the function, as follows:

accept: function(element) {
   return (your_condition_1 
     && !(element.hasClass('ui-sortable-helper'))
   );
},
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜