jquery實現(xiàn)鼠標(biāo)拖拽滑動效果來選擇數(shù)字的方法
本文實例講述了jquery實現(xiàn)鼠標(biāo)拖拽滑動效果來選擇數(shù)字的方法。分享給大家供大家參考。具體如下:
這是使用jquery ui實現(xiàn)的一個精美實用的效果,可以通過鼠標(biāo)拖拽滑動效果來選擇數(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>
希望本文所述對大家的jQuery程序設(shè)計有所幫助。
相關(guān)文章
jQuery實現(xiàn)表格奇偶行顯示不同背景色 就這么簡單
這篇文章主要為大家詳細(xì)介紹了jQuery實現(xiàn)表格奇偶行顯示不同背景色的方法,使表格更加美觀,便捷的查找同行數(shù)據(jù)更,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-03-03tuzhu_req.js 實現(xiàn)仿百度圖片首頁效果
這篇文章主要介紹了tuzhu_req.js 實現(xiàn)仿百度圖片首頁效果的相關(guān)資料,需要的朋友可以參考下2015-08-08jquery實現(xiàn)Ajax請求的幾種常見方式總結(jié)
這篇文章主要介紹了jquery實現(xiàn)Ajax請求的幾種常見方式,結(jié)合實例形式總結(jié)分析了jQuery實現(xiàn)ajax請求常用的load()、post()、get()及Ajax()方法相關(guān)操作技巧,需要的朋友可以參考下2019-05-05jQuery+JSON實現(xiàn)AJAX二級聯(lián)動實例分析
這篇文章主要介紹了jQuery+JSON實現(xiàn)AJAX二級聯(lián)動的方法,以實例形式分析了前臺jQuery結(jié)合ajax傳遞json格式數(shù)據(jù)及后臺數(shù)據(jù)處理技巧,具有一定參考借鑒價值,需要的朋友可以參考下2015-12-12分享20款美化網(wǎng)站的 jQuery Lightbox 燈箱插件
這篇文章主要介紹了分享20款美化網(wǎng)站的 jQuery Lightbox 燈箱插件,需要的朋友可以參考下2014-10-10