jquery - How to keep the selected state of UI Selectable until I want to unselected? -
i want hold selected stated of li until want unselected.just previous question before:
<style> #feedback { font-size: 1.4em; } #selectable .ui-selecting { background: #feca40; } #selectable .ui-selected { background: #f39814; color: white; } #selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; } #selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; } </style> <script> $(function() { $( "#selectable" ).selectable(); $('#unselect').click(function(event) { $('#selectable>li').removeclass('ui-selected'); }); }); </script> <div class="demo"> <ol id="selectable"> <li class="ui-widget-content"><a href="">link can not click</a></li> <li class="ui-widget-content">item 2</li> <li class="ui-widget-content">item 3</li> <li class="ui-widget-content">item 4</li> <li class="ui-widget-content">item 5</li> <li class="ui-widget-content">item 6</li> <li class="ui-widget-content">item 7</li> </ol> <a href="#" id="unselect">only click me unselected</a> </div><!-- end demo -->
i got an anchor link
unselected , way unselected selected li
.how can prevent selected li unselected other way??
i found selected li should unselecte when click ul scrollbar if li list overflow ul height.
thank much!!
try one..
$(function() { $( "#selectable" ).selectable(); $('#unselect').click(function(event) { $('#selectable').find('li').removeclass('ui-selected'); });
Comments
Post a Comment