开发者

How to mix few jQuery UI range slider together?

Anyone know how to mix few jQuery UI range draggable slider together?

Sample Image that showing what I mean: Click here

Sample code for single range draggable slider:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css" type="text/css" />

<script type="text/javascript">
    $(function() {
        $( "#slider-range" ).slider({
            range: true,
            min: 71,
         开发者_如何学C   max: 109,
            values: [75, 100],
            slide: function( event, ui ) {
                $("#size-range").html(Math.floor(ui.values[0] / 12) + "'" + (ui.values[0] % 12) + '" - ' + Math.floor(ui.values[1] / 12) + "'" + (ui.values[1] % 12) + '"');
                $("#min_inches").val(ui.values[0]);
                $("#max_inches").val(ui.values[1]);
            }
        });
        $("#size-range").html(Math.floor($("#slider-range").slider("values", 0) / 12) + "'" + ($("#slider-range").slider("values", 0) % 12) + '" - ' + Math.floor($("#slider-range").slider("values", 1) / 12) + "'" + ($("#slider-range").slider("values", 1) % 12) + '"');
        $("#min_inches").val($("#slider-range").slider("values", 0));
        $("#max_inches").val($("#slider-range").slider("values", 1));
    });
    </script>

    <p>Size Range: <strong><span id="size-range"></span></strong> <small><em>(drag slider handles below to specify)</em></small></p>

    <div id="slider-range"></div>

    <input type="text" name="min_inches" id="min_inches" value="" />
    <input type="text" name="max_inches" id="max_inches" value="" />

..please help me.


Look at this solution: http://www.kelvinluck.com/assets/jquery/ui-slider/slider_test.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜