JQuery UI Slider issue
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></scr开发者_如何学JAVAipt>
<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
just try
$("#slide1").slider('values', 0, 10);
$("#slide1").slider('values', 1, 20);
Hope that will help :)
first of all, you need to right proper code :)
- Always end a javascript line with ;
- Read the documentation ! :-)
you are using
slider( 'values' : [5 , 20] )
and it should be
slider({ values : [5 , 20] })
I've not used the slider, but see if this helps:
$(".selector").slider({ min: 5, max: 20 });
精彩评论