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 :)
精彩评论