开发者

jQuery UI: Make an item selected?

开发者 https://www.devze.com 2023-01-07 22:27 出处:网络
If I have a list and a link, like this: <a href=\"\">Select</a> <ul> <li>f</li>

If I have a list and a link, like this:

<a href="">Select</a>

<ul>
    <li>f</li>
    <li>fd</li>
    <li>fa</li>
    <li>fd</li>
</ul>

<script> $("ul").selectable(); </script>

Is it possible to make an item be selected on any arbitrary event? Something like:

$('a').bind('click', function()
{
      $('.ul-selectable').children().first().select('on');
      $('.开发者_Python百科ul-selectable').children().last().select('off');
});


Why not? Just create a class and on selecting a particular item apply that class to that particular item :)

0

精彩评论

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