4 <meta charset=
"UTF-8" />
5 <title>jQuery UI Selectable - Default functionality
</title>
6 <link type=
"text/css" href=
"css/ui-lightness/jquery-ui-1.8.1.custom.css" rel=
"stylesheet" />
7 <script type=
"text/javascript" src=
"js/jquery-1.4.4.min.js"></script>
8 <script type=
"text/javascript" src=
"js/jquery-ui-1.8.10.custom.min.js"></script>
10 <style type=
"text/css">
11 #feedback { font-size: 1.4em; }
12 #selectable .ui-selecting
{ background: #FECA40; }
13 #selectable .ui-selected
{ background: #F39814; color: white
; }
14 #selectable { list-style-type: none
; margin: 0; padding: 0; width: 60%; }
15 #selectable li
{ margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; }
17 <script type=
"text/javascript">
19 $("#selectable").selectable({
21 var infodiv
= $("#infodiv").empty();
22 $(".ui-selected", this).each(function() {
23 var that_id
= this.id
;
24 infodiv
.append(' #' + that_id
);
29 $("button").click(function() {
30 var list_disabled
= $("#selectable").selectable("option", "disabled");
31 $("#infodiv").find('p').html('Disabled: ' + !list_disabled
);
32 $("#selectable").selectable("option", "disabled", !list_disabled
);
41 <li id=
"item1" class=
"ui-widget-content">Item
1</li>
42 <li id=
"item2" class=
"ui-widget-content">Item
2</li>
43 <li id=
"item3" class=
"ui-widget-content">Item
3</li>
44 <li id=
"item4" class=
"ui-widget-content">Item
4</li>
45 <li id=
"item5" class=
"ui-widget-content">Item
5</li>
46 <li id=
"item6" class=
"ui-widget-content">Item
6</li>
47 <li id=
"item7" class=
"ui-widget-content">Item
7</li>
50 </div><!-- End demo -->
52 <div class=
"demo-description">
54 <p>Enable a DOM element (or group of elements) to be selectable. Draw a box with your cursor to select items. Hold down the Ctrl key to make multiple non-adjacent selections.
</p>
56 <button type=
"button" id=
"somebutton">Click to lock
</button>
63 </div><!-- End demo-description -->