国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

jQuery實現(xiàn)移動端滑塊拖動選擇數(shù)字效果

2019-11-20 10:56:55
字體:
供稿:網(wǎng)友

本文為大家分享了基于jquery ui實現(xiàn)的一個精美實用的效果,可以通過鼠標拖拽滑動效果來選擇數(shù)字,供大家參考,具體內(nèi)容如下

運行效果圖:

實現(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實現(xiàn)移動端滑塊拖動選擇數(shù)字效果的代碼,希望對大家的學習有所幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 文山县| 保康县| 芦山县| 忻州市| 昌江| 吴堡县| 新巴尔虎右旗| 福建省| 阳高县| 惠来县| 蓝山县| 左权县| 江西省| 长宁区| 巫溪县| 曲靖市| 三门县| 青冈县| 于都县| 崇礼县| 威远县| 东山县| 黄大仙区| 淅川县| 邓州市| 长春市| 永顺县| 安庆市| 山东| 伊吾县| 惠安县| 库伦旗| 许昌县| 麻栗坡县| 北辰区| 通化市| 莲花县| 兴国县| 策勒县| 商河县| 大冶市|