javascript - How to not allow parts of sortable jquery list to move? - Stack Overflow

I made a sortable list:<ul><li class="line"><a href="#" class="

I made a sortable list:

<ul>
   <li class="line"><a href="#" class="food">milk</a></li>
   <li class="line"><a href="#" class="food">eggs</a></li>
   <li class="line"><a href="#" class="food">cheese</a></li>
</ul>

However, I want to make everything with class food not draggable. Since they are links, sometimes when people click them, they accidently reorder the list. Does anyone know how to make just the "food" class items not "draggable"?

I made a sortable list:

<ul>
   <li class="line"><a href="#" class="food">milk</a></li>
   <li class="line"><a href="#" class="food">eggs</a></li>
   <li class="line"><a href="#" class="food">cheese</a></li>
</ul>

However, I want to make everything with class food not draggable. Since they are links, sometimes when people click them, they accidently reorder the list. Does anyone know how to make just the "food" class items not "draggable"?

Share Improve this question asked Mar 8, 2010 at 0:33 sanpellsanpell 911 silver badge3 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Presuming your sortable selector is .line :

$('.line').sortable({ cancel: 'a.food' });

See: The cancel option in the jQuery UI documentation for details.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745118696a4612284.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信