Search code examples
jqueryjquery-uijquery-pluginsslideruislider

JQuery UI Slider issue


<html>
  <head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript"></script>
    <link href="http://localhost/test/styles/jquery/ui/skins/redmond/jquery-ui-1.7.2.custom.css" media="screen" rel="stylesheet" type="text/css" />

    <style type="text/css">
        #demo-frame > div.demo { padding: 10px !important; };
    </style>

    <script type="text/javascript">
      $(function() {
        $(".slider-range").slider({
            range: true,
            min: 0,
            max: 24

        });
      });
    </script>

</head>
<body>

    <div class="demo">
        <p>
            <label for="amount">Time range:</label>
            <input type="text" id="amount1" style="border:0; color:#f6931f; font-weight:bold;" value="" />
            <input type="text" id="amount2" style="border:0; color:#f6931f; font-weight:bold;" value="" />
            <input type="text" id="amount3" style="border:0; color:#f6931f; font-weight:bold;" value="" />
        </p>

        <div id="slider-range1" class="slider-range"></div>
        <div id="slider-range2" class="slider-range"></div>
        <div id="slider-range3" class="slider-range"></div>

    </div>

        <script type="text/javascript">
        <?php for ($i=1; $i<=3;$i++) { ?>
            $("#slider-range" + <?php =$i?>).slider( 'values' : [5 , 20] )
        <?php } ?>
        </script>
</body>
</html>

I have above code but it is not point at 5 and 20 also the range is changed from 0-24 to 0-100 .. Please help me to solve this issue... instead of 5 and 20 .. my value coming from databasse....

Regards Nisanth


Solution

  • just try

    $("#slide1").slider('values', 0, 10);
    $("#slide1").slider('values', 1, 20);
    

    Hope that will help :)