]> source.dussan.org Git - jquery-ui.git/commitdiff
Spinner: Adding overflow demo
authorjzaefferer <joern.zaefferer@gmail.com>
Tue, 2 Nov 2010 15:41:11 +0000 (16:41 +0100)
committerjzaefferer <joern.zaefferer@gmail.com>
Tue, 2 Nov 2010 15:41:11 +0000 (16:41 +0100)
demos/spinner/index.html
demos/spinner/overflow.html [new file with mode: 0644]

index f43f6e2a187b682f5fe291ad748284495e35f550..766f6552c82b72e710f4dd04e9d55183050f3609 100644 (file)
@@ -13,6 +13,7 @@
                        <li><a href="currency.html">Currency</a></li>\r
                        <li><a href="latlong.html">Map</a></li>\r
                        <li><a href="mousewheel-disabled.html">Mousewheel Disabled</a></li>\r
+                       <li><a href="overflow.html">Overflow</a></li>\r
                </ul>\r
        </div>\r
 </body>\r
diff --git a/demos/spinner/overflow.html b/demos/spinner/overflow.html
new file mode 100644 (file)
index 0000000..7164891
--- /dev/null
@@ -0,0 +1,47 @@
+<!doctype html>\r
+<html lang="en">\r
+<head>\r
+       <meta charset="utf-8">\r
+       <title>jQuery UI Spinner - Default functionality</title>\r
+       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />\r
+       <script type="text/javascript" src="../../jquery-1.4.3.js"></script>\r
+       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>\r
+       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>\r
+       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>\r
+       <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>\r
+       <script type="text/javascript" src="../../ui/jquery.ui.spinner.js"></script>\r
+       <link type="text/css" href="../demos.css" rel="stylesheet" />\r
+       <script type="text/javascript">\r
+       $(function() {\r
+               $("#spinner").spinner({\r
+                       spin: function(event, ui) {\r
+                               if (ui.value > 10) {\r
+                                       $(this).spinner("value", -10);\r
+                                       return false;\r
+                               } else if (ui.value < -10) {\r
+                                       $(this).spinner("value", 10);\r
+                                       return false;\r
+                               }\r
+                       }\r
+               });\r
+       });\r
+       </script>\r
+</head>\r
+<body>\r
+\r
+<div class="demo">\r
+       <p>\r
+               <label for="spinner">Select a value:</label>\r
+               <input id="spinner" name="value" />\r
+       </p>\r
+</div>\r
+\r
+<div class="demo-description">\r
+       <p>\r
+               Overflowing spinner restricted to a range of -10 to 10.\r
+               For anything above 10, it'll overflow to -10, and the other way round.\r
+       </p>\r
+</div>\r
+\r
+</body>\r
+</html>\r