5 <title>jQuery UI Selectable - Serialize</title>
6 <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
7 <script src="../../jquery-1.9.1.js"></script>
8 <script src="../../ui/jquery.ui.core.js"></script>
9 <script src="../../ui/jquery.ui.widget.js"></script>
10 <script src="../../ui/jquery.ui.mouse.js"></script>
11 <script src="../../ui/jquery.ui.selectable.js"></script>
12 <link rel="stylesheet" href="../demos.css">
15 #feedback { font-size: 1.4em; }
16 #selectable .ui-selecting { background: #FECA40; }
17 #selectable .ui-selected { background: #F39814; color: white; }
18 #selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
19 #selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; }
23 $( "#selectable" ).selectable({
25 var result = $( "#select-result" ).empty();
26 $( ".ui-selected", this ).each(function() {
27 var index = $( "#selectable li" ).index( this );
28 result.append( " #" + ( index + 1 ) );
38 <span>You've selected:</span> <span id="select-result">none</span>.
42 <li class="ui-widget-content">Item 1</li>
43 <li class="ui-widget-content">Item 2</li>
44 <li class="ui-widget-content">Item 3</li>
45 <li class="ui-widget-content">Item 4</li>
46 <li class="ui-widget-content">Item 5</li>
47 <li class="ui-widget-content">Item 6</li>
50 <div class="demo-description">
51 <p>Write a function that fires on the <code>stop</code> event to collect the index values of selected items. Present values as feedback, or pass as a data string.</p>