jquery實(shí)現(xiàn)鼠標(biāo)拖拽滑動(dòng)效果來(lái)選擇數(shù)字的方法
本文實(shí)例講述了jquery實(shí)現(xiàn)鼠標(biāo)拖拽滑動(dòng)效果來(lái)選擇數(shù)字的方法。分享給大家供大家參考。具體如下:
這是使用jquery ui實(shí)現(xiàn)的一個(gè)精美實(shí)用的效果,可以通過(guò)鼠標(biāo)拖拽滑動(dòng)效果來(lái)選擇數(shù)字
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <title>demo</title> <link rel="stylesheet" href="css/jquery-ui.css"> <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="js/jquery-1.10.2.js"></script> <script src="js/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>
希望本文所述對(duì)大家的jQuery程序設(shè)計(jì)有所幫助。
相關(guān)文章
jQuery中removeClass()方法用法實(shí)例
這篇文章主要介紹了jQuery中removeClass()方法用法,實(shí)例分析了removeClass()方法的功能、定義及從匹配元素刪除一個(gè)或多個(gè)類的使用技巧,需要的朋友可以參考下2015-01-01jQuery實(shí)現(xiàn)表格奇偶行顯示不同背景色 就這么簡(jiǎn)單
這篇文章主要為大家詳細(xì)介紹了jQuery實(shí)現(xiàn)表格奇偶行顯示不同背景色的方法,使表格更加美觀,便捷的查找同行數(shù)據(jù)更,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-03-03tuzhu_req.js 實(shí)現(xiàn)仿百度圖片首頁(yè)效果
這篇文章主要介紹了tuzhu_req.js 實(shí)現(xiàn)仿百度圖片首頁(yè)效果的相關(guān)資料,需要的朋友可以參考下2015-08-08jQuery簡(jiǎn)單實(shí)現(xiàn)MD5加密的方法
這篇文章主要介紹了jQuery簡(jiǎn)單實(shí)現(xiàn)MD5加密的方法,基于jquery.md5.js插件實(shí)現(xiàn)md5加密功能,非常簡(jiǎn)單實(shí)用,需要的朋友可以參考下2017-03-03jQuery實(shí)現(xiàn)簡(jiǎn)單的手風(fēng)琴效果
這篇文章主要為大家詳細(xì)介紹了jQuery實(shí)現(xiàn)簡(jiǎn)單的手風(fēng)琴效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-06-06jquery mobile開(kāi)發(fā)常見(jiàn)問(wèn)題分析
這篇文章主要介紹了jquery mobile開(kāi)發(fā)常見(jiàn)問(wèn)題,結(jié)合實(shí)例形式分析了jQuery mobile插件使用過(guò)程中的常見(jiàn)錯(cuò)誤問(wèn)題與對(duì)應(yīng)的解決方法,需要的朋友可以參考下2016-01-01jquery實(shí)現(xiàn)Ajax請(qǐng)求的幾種常見(jiàn)方式總結(jié)
這篇文章主要介紹了jquery實(shí)現(xiàn)Ajax請(qǐng)求的幾種常見(jiàn)方式,結(jié)合實(shí)例形式總結(jié)分析了jQuery實(shí)現(xiàn)ajax請(qǐng)求常用的load()、post()、get()及Ajax()方法相關(guān)操作技巧,需要的朋友可以參考下2019-05-05jQuery+JSON實(shí)現(xiàn)AJAX二級(jí)聯(lián)動(dòng)實(shí)例分析
這篇文章主要介紹了jQuery+JSON實(shí)現(xiàn)AJAX二級(jí)聯(lián)動(dòng)的方法,以實(shí)例形式分析了前臺(tái)jQuery結(jié)合ajax傳遞json格式數(shù)據(jù)及后臺(tái)數(shù)據(jù)處理技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-12-12分享20款美化網(wǎng)站的 jQuery Lightbox 燈箱插件
這篇文章主要介紹了分享20款美化網(wǎng)站的 jQuery Lightbox 燈箱插件,需要的朋友可以參考下2014-10-10