开发者

on an unordered list, how do I restrict one list item from being selectable?

开发者 https://www.devze.com 2023-04-06 09:51 出处:网络
A quick sketch of my situation is: <ul id=\"selectable\"> <li class=\"t开发者_开发问答able\" id=\"header-row\">

A quick sketch of my situation is:

<ul id="selectable">
  <li class="t开发者_开发问答able" id="header-row">
    <ul class="row">
      ...
    </ul>
  </li>
  <li class="table">
    <ul class="row">
      ...
    </ul>
  </li>
  ...
</ul>

How do I disable li#header-row from being selectable?


You can use the filter option to include (or with :not, exclude) options

$("#selectable").selectable({
    filter: ":not(#header-row)"
});

JSFiddle: http://jsfiddle.net/M7pmU/

0

精彩评论

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