Skip to content
Karl edited this page Sep 29, 2018 · 6 revisions

Type String|Array|Boolean

Default false

Define descendants of selectable elements that can be clicked. Can be a CSS3 selector string or an array of CSS3 selector strings. Any descendant defined will not trigger the instance to start selecting / toggling when clicked on.


Examples

Allow only span elements and elements with the .clickable className.

<ul>
    <li class="item">
        <a href="#" class="clickable">I can be clicked</a>
        <a href="#" class="unclickable">I can't be clicked</a>
        <span>I can be clicked</span>
    </li>
    <li class="item">
        <a href="#" class="clickable">I can be clicked</a>
        <a href="#" class="unclickable">I can't be clicked</a>
        <span>I can be clicked</span>
    </li>
    ...
</ul>
new Selectable({
    filter: ".item",
    ignore: [".clickable", "span"]
});
Clone this wiki locally