开发者

jQuery UI: Make an item selected?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜