DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> jQuery入門知識 >> JQuery特效代碼 >> jQuery實現的輸入框選擇時間插件用法實例教程
jQuery實現的輸入框選擇時間插件用法實例教程
編輯:JQuery特效代碼     

本文實例講述了jQuery實現的輸入框選擇時間插件用法。分享給大家供大家參考。具體實現方法如下:

代碼如下:<!dooCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta charset = utf8>
<title>jQuery實現的輸入框選擇時間插件</title>
<script charset="utf-8" src="/js/jquery-1.6.2.min.js"></script>
<script charset="utf-8" src="/js/jquery.settime.js"></script>
</head>
<body>
<p id="msg">msg </p>
<p >time1<input id="time" value="" /></p>
<p >time2<input id="time2" value="" /></p>
<p >time3<input id="time3" value="" /></p>
<p ><input type = button id="button" value="button"/></p>
<div>
</div>
<script>
$('#time').setTime();
$('#time2').setTime({
drag:true,
h:[5,20],
i:[5,50],
s:[5,45],
a:0.05,
constraint:'',
'starteffect': function(d){
$('#msg').html(d[0]);
},
'onmove':function(e){
$('#msg').html(e[0] + '/' + e[1])
},
zindex:'0',
'cursor':'move',
'area':[[50,600],[10 ,5000]],
'callback':function(){
//alert(1)
}
});
$('#time3').setTime({
drag:true,
a:0.05
});
$('#button').click(function(){
alert( $('#time').val() );
alert( $('#time2').val() );
alert( $('#time3').val() );
});
</script>
</body>
</html>

本文中的時間插件jquery.settime.js點擊此處本站下載。

希望本文所述對大家的jQuery程序設計有所幫助。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved