How to create a jQuery price slider

北慕城南 提交于 2019-12-11 04:02:24

问题


I have been trying to find a tutorial but had had no luck. I'm not asking anyone to do the work for me but more to see if anyone knows anything useful.

so basically i need my slider to to have a minimum value of zero and a dynamically set maximum value (getting the dynamic value is not an issue).

0 -------------------o------------------ 200

So the 'o' in the middle would be your clickable sliding element. I need it to output in a box to the right the number that you are on. So in this example it would output 100. Very much like setting the volume on a video player.

Basically this is for a reward point system, so people can slider across how many reward points they have and it will output how many pounds this is the equivalent of.

As i said im more looking for help finding a tutorial but would always be grateful if someone could post a snippet that would push me in the right direction.


回答1:


Take a look at http://jqueryui.com/slider/#range

This will give you a range slider for values like you require




回答2:


Try this:

http://jquerymobile.com/demos/1.0a2/#docs/forms/forms-slider.html

<body class=""> 
<link rel="stylesheet" href="jquery.css">

<script src="jquery-1.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<div class="" id="" data-role="page">

<div class="ui-field-contain ui-body ui-br" data-role="fieldcontain">
<input class="" name="slider" id="slider" value="100" min="0" max="10" data-type="range">
</div>



来源:https://stackoverflow.com/questions/15200329/how-to-create-a-jquery-price-slider

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!