|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>jQuery UI Selectmenu - Event functionality</title> |
| 6 | + <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css"> |
| 7 | + <script src="../../../jquery-1.6.2.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.position.js"></script> |
| 11 | + <script src="../../../ui/jquery.ui.button.js"></script> |
| 12 | + <script src="../../../ui/jquery.ui.menu.js"></script> |
| 13 | + <script src="../../../ui/jquery.ui.selectmenu.js"></script> |
| 14 | + <link rel="stylesheet" href="../../../demos/demos.css"> |
| 15 | + <script> |
| 16 | + $(function() { |
| 17 | + var mySelectmenu = $('select').selectmenu(); |
| 18 | + |
| 19 | + $("#destroy").click( function() { |
| 20 | + mySelectmenu.selectmenu("destroy"); |
| 21 | + }); |
| 22 | + |
| 23 | + $("#refresh").click( function() { |
| 24 | + mySelectmenu.append('<option value="fastsound">Faster than sound</option>'); |
| 25 | + mySelectmenu.selectmenu("refresh"); |
| 26 | + }); |
| 27 | + }); |
| 28 | + </script> |
| 29 | + <style> |
| 30 | + form { margin: 20px 0 0 0 } |
| 31 | + fieldset { border: 0; } |
| 32 | + label { display: block; } |
| 33 | + select { width: 200px; } |
| 34 | + .overflow ul { height: 200px; overflow: auto; } |
| 35 | + </style> |
| 36 | +</head> |
| 37 | +<body> |
| 38 | + |
| 39 | +<div class="demo"> |
| 40 | + |
| 41 | +<form action="#"> |
| 42 | + <fieldset> |
| 43 | + <label for="speed">Select a speed:</label> |
| 44 | + <select name="speed" id="speed"> |
| 45 | + <option value="Slower">Slower</option> |
| 46 | + <option value="Slow">Slow</option> |
| 47 | + <option value="Medium" selected="selected">Medium</option> |
| 48 | + <option value="Fast">Fast</option> |
| 49 | + <option value="Faster">Faster</option> |
| 50 | + </select> |
| 51 | + </fieldset> |
| 52 | +</form> |
| 53 | +<br /> |
| 54 | +<button id="destroy">Destroy</button> |
| 55 | +<button id="refresh">Add item and refresh</button> |
| 56 | + |
| 57 | +</div><!-- End demo --> |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +</body> |
| 62 | +</html> |
0 commit comments