javascript - What does the #feedback selector reference in the JQueryUI demos -
i'm looking @ "selectable" demos. here example code reference:
<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(); }); </script> </head> <body> <ol id="selectable"> <li class="ui-widget-content">item 1</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> </body> </html>
none of html contains id of "feedback" , i've tried commenting #feedback
styling in , out, can't see difference.
thanks
i think copy-paste of example css code of jquery ui selectable. needed third example serialize
@ <p id="feedback">
.
demo code:
<html lang="en"> <head> <meta charset="utf-8" /> <title>jquery ui selectable - serialize</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css" /> <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({ stop: function() { var result = $( "#select-result" ).empty(); $( ".ui-selected", ).each(function() { var index = $( "#selectable li" ).index( ); result.append( " #" + ( index + 1 ) ); }); } }); }); </script> </head> <body> <p id="feedback"> <span>you've selected:</span> <span id="select-result">none</span>. </p> <ol id="selectable"> <li class="ui-widget-content">item 1</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> </ol> </body> </html>
Comments
Post a Comment