Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Slider UI - Enhancements

Tags:

I was trying out jQuery Slider and used an example to play around.

EDIT: I would like to have the slider show the values, like a ruler, to increase usability. As it is now, I am finding it difficult to pass the usability testing. People complain that they want to know what value they are picking before they start sliding.

Any ideas how I can achieve this ? As far as I searched, I could not find out about whether this feature already exists or about how to do this.

<html>
<head>
<link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.slider.js"></script>
<style type="text/css">
    #slider { margin: 10px; }
</style>
<script type="text/javascript">
    $(function() {
        $("#slider").slider({           
            value: 50,
            min: 0,
            max: 99,
            step: 1,
            slide: function(event, ui) {
                $("#amount").val('$' + ui.value);
            }
        });
        $("#amount").val('$' + $("#slider").slider("value"));
    });
</script>
</head>
<body style="font-size:62.5%;">
<div id="slider"></div>
<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
</body>
</html>
like image 551
Vijay Dev Avatar asked Apr 30 '09 14:04

Vijay Dev


1 Answers

I found an example of a custom JQuery UI Slider that displays hash markings.

jQuery UI Slider from a Select Element

This should give you a good starting point. Let me know if you need help.

like image 136
bchang Avatar answered Oct 05 '22 14:10

bchang