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="https://www.jb51.net/js/jquery-1.6.2.min.js"></script>
<script charset="utf-8" src="https://www.jb51.net/js/jquery.settime.js"></script>
</head>
<body>
<p>msg </p>
<p >time1<input value="" /></p>
<p >time2<input value="" /></p>
<p >time3<input value="" /></p>
<p ><input type = 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] + 'https://www.jb51.net/' + 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>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wgfjwd.html