JqueryUI Money. Set the range option to true to capture a range of values with two drag handles


SUBMITTED BY: jlolk3r

DATE: Jan. 22, 2016, 9:32 a.m.

FORMAT: HTML

SIZE: 1.1 kB

HITS: 716

  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>jQuery UI Slider - Range slider</title>
  6. <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  7. <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  8. <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  9. <link rel="stylesheet" href="/resources/demos/style.css">
  10. <script>
  11. $(function() {
  12. $( "#slider-range" ).slider({
  13. range: true,
  14. min: 0,
  15. max: 500,
  16. values: [ 75, 300 ],
  17. slide: function( event, ui ) {
  18. $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
  19. }
  20. });
  21. $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
  22. " - $" + $( "#slider-range" ).slider( "values", 1 ) );
  23. });
  24. </script>
  25. </head>
  26. <body>
  27. <p>
  28. <label for="amount">Price range:</label>
  29. <input type="text" id="amount" readonly style="border:0; color:#f6931f; font-weight:bold;">
  30. </p>
  31. <div id="slider-range"></div>
  32. </body>
  33. </html>

comments powered by Disqus