jQuery實(shí)現(xiàn)移動(dòng)端滑塊拖動(dòng)選擇數(shù)字效果
本文為大家分享了基于jquery ui實(shí)現(xiàn)的一個(gè)精美實(shí)用的效果,可以通過鼠標(biāo)拖拽滑動(dòng)效果來(lái)選擇數(shù)字,供大家參考,具體內(nèi)容如下
運(yùn)行效果圖:

實(shí)現(xiàn)代碼:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="gb2312">
<title>demo</title>
<link rel="stylesheet" >
<style>
.slider-box{ background:#F0EFEB; font-family:Microsoft Yahei; padding-bottom:10px}
.slider-box .item{ padding:10px}
.slider-box .item .tag, .slider-box .item .slider, .slider-box .item .val{ float:left; margin-right:18px}
.slider-box .item .slider{ width:400px}
.slider-box .item .slider div{ background:#8FBF0B; border:none; height:0.5em; margin-top:0.5em}
.slider-box .item .slider div .ui-slider-handle{ background:#F4F3F1; width:1em; height:1em; border-radius:1em}
.slider-box .item .val input{ border:none; border-bottom:1px solid #ABADA8; background:none; padding:0.1em 1em; color:#E4531C; font-weight:bold; font-size:1em; width:5em; text-align:center}
.clr{ clear:both}
</style>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
</head>
<body>
<div class="slider-box">
<div class="item">
<div class="tag">騎行里程:</div>
<div class="slider">
<div id="budget"></div>
</div>
<div class="val"><input value="8800" name="budget" /></div>
</div>
<div class="clr"></div>
<div class="item">
<div class="tag">騎行天數(shù):</div>
<div class="slider">
<div id="days"></div>
</div>
<div class="val"><input value="9" name="days" /></div>
</div>
<div class="clr"></div>
</div>
<script>
$("#budget").slider({
min: 2000,
max: 17000,
step: 100,
value: $('input[name="budget"]').val(),
slide: function( event, ui ) {
$('input[name="budget"]').val(ui.value)
}
});
$("#days").slider({
min: 1,
max: 20,
value: $('input[name="days"]').val(),
slide: function( event, ui ) {
$('input[name="days"]').val(ui.value)
}
});
</script>
</body>
</html>
以上就是jQuery實(shí)現(xiàn)移動(dòng)端滑塊拖動(dòng)選擇數(shù)字效果的代碼,希望對(duì)大家的學(xué)習(xí)有所幫助。
相關(guān)文章
jQuery控制div實(shí)現(xiàn)隨滾動(dòng)條滾動(dòng)效果
這篇文章主要介紹了jQuery控制div實(shí)現(xiàn)隨滾動(dòng)條滾動(dòng)效果,對(duì)比分析了兩種實(shí)現(xiàn)方法供大家參考選擇,需要的朋友可以參考下2016-06-06
jQuery彈層插件jquery.fancybox.js用法實(shí)例
這篇文章主要介紹了jQuery彈層插件jquery.fancybox.js用法,結(jié)合實(shí)例形式分析了jQuery彈出層插件jquery.fancybox.js的功能、用法與相關(guān)注意事項(xiàng),需要的朋友可以參考下2016-01-01
基于jquery的兼容各種瀏覽器的iframe自適應(yīng)高度的腳本
在網(wǎng)上找了很多的iframe自適應(yīng)高度的腳本,對(duì)瀏覽的的兼容性都不好。所以就想利用jquery強(qiáng)大的兼容性,寫一個(gè)iframe自適應(yīng)高度的腳本。2010-08-08
jQuery實(shí)現(xiàn)鼠標(biāo)滑過點(diǎn)擊事件音效試聽
本文給大家介紹jquery鼠標(biāo)滑過點(diǎn)擊事件音效試聽,使用jquery插件實(shí)現(xiàn)的特效,感興趣的朋友一起來(lái)學(xué)習(xí)吧。2015-08-08
利用jquery實(shí)現(xiàn)實(shí)時(shí)更新歌詞的方法
這篇文章主要給大家介紹了如何利用jquery實(shí)現(xiàn)實(shí)時(shí)更新歌詞的方法,文中給出了詳細(xì)的實(shí)現(xiàn)思路和示例代碼,對(duì)大家的參考借鑒具有一定的價(jià)值,有需要的朋友下面來(lái)跟著小編一起學(xué)習(xí)學(xué)習(xí)吧。2017-01-01
Jquery實(shí)現(xiàn)瀑布流布局(備有詳細(xì)注釋)
這篇文章主要介紹了Jquery實(shí)現(xiàn)瀑布流布局的方法,可實(shí)現(xiàn)圖片的動(dòng)態(tài)加載功能,且代碼備有詳細(xì)注釋便于理解,需要的朋友可以參考下2015-07-07
jquery ajax結(jié)合thinkphp的getjson實(shí)現(xiàn)跨域的方法
這篇文章主要介紹了jquery ajax結(jié)合thinkphp的getjson實(shí)現(xiàn)跨域的方法,結(jié)合實(shí)例形式對(duì)比分析了jQuery ajax實(shí)現(xiàn)跨域的具體操作技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2016-06-06

