jQuery之手势密码
2016-05-17 08:03
666 查看
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>jQuery手势密码</title>
</head>
<body>
<center><br><br>
正确的密码是一个字母“Z”的形状哦!<br><br>
<div id="gesturepwd"></div>
</center>
<script src="http://files.cnblogs.com/files/caidupingblogs/jquery-2.1.4.min.js"></script>
<script src="http://files.cnblogs.com/files/caidupingblogs/jquery.gesture.password.js"></script>
<!--<script src="http://files.cnblogs.com/files/caidupingblogs/jquery.gesture.password.min.js"></script>-->
<script>
$("#gesturepwd").GesturePasswd({
backgroundColor:"#252736", //背景色
color:"#FFFFFF", //主要的控件颜色
roundRadii:25, //大圆点的半径
pointRadii:6, //大圆点被选中时显示的圆心的半径
space:30, //大圆点之间的间隙
width:240, //整个组件的宽度
height:240, //整个组件的高度
lineColor:"#00aec7", //用户划出线条的颜色
zindex :100 //整个组件的css z-index属性
});
$("#gesturepwd").on("hasPasswd",function(e,passwd){
var result;
if(passwd == "1235789"){
result=true;
}
else {
result=false;
}
if(result == true){
$("#gesturepwd").trigger("passwdRight");
setTimeout(function(){
//密码验证正确后的其他操作,打开新的页面等。。。
alert("密码正确!")
},500); //延迟半秒以照顾视觉效果
}
else{
$("#gesturepwd").trigger("passwdWrong");
//密码验证错误后的其他操作。。。
}
});
</script>
</body>
</html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>jQuery手势密码</title>
</head>
<body>
<center><br><br>
正确的密码是一个字母“Z”的形状哦!<br><br>
<div id="gesturepwd"></div>
</center>
<script src="http://files.cnblogs.com/files/caidupingblogs/jquery-2.1.4.min.js"></script>
<script src="http://files.cnblogs.com/files/caidupingblogs/jquery.gesture.password.js"></script>
<!--<script src="http://files.cnblogs.com/files/caidupingblogs/jquery.gesture.password.min.js"></script>-->
<script>
$("#gesturepwd").GesturePasswd({
backgroundColor:"#252736", //背景色
color:"#FFFFFF", //主要的控件颜色
roundRadii:25, //大圆点的半径
pointRadii:6, //大圆点被选中时显示的圆心的半径
space:30, //大圆点之间的间隙
width:240, //整个组件的宽度
height:240, //整个组件的高度
lineColor:"#00aec7", //用户划出线条的颜色
zindex :100 //整个组件的css z-index属性
});
$("#gesturepwd").on("hasPasswd",function(e,passwd){
var result;
if(passwd == "1235789"){
result=true;
}
else {
result=false;
}
if(result == true){
$("#gesturepwd").trigger("passwdRight");
setTimeout(function(){
//密码验证正确后的其他操作,打开新的页面等。。。
alert("密码正确!")
},500); //延迟半秒以照顾视觉效果
}
else{
$("#gesturepwd").trigger("passwdWrong");
//密码验证错误后的其他操作。。。
}
});
</script>
</body>
</html>
相关文章推荐
- jquery遍历ajax返回的json数据
- jquery获取img的src值的简单实例
- 使用jQuery Mobile框架开发移动端Web App的入门教程
- Jquery修改image的src属性,图片不加载问题的解决方法
- 手机触屏触摸特效javascript-TouchSwipe(依赖于jquery库)中文说明
- jQuery中ready与load事件的区别
- JQuery日期插件datepicker的使用
- 二维码篇【一】【JS】使用jquery.qrcode生成二维码
- JQuery日期插件datepicker的使用
- 基于jQuery的一个简单的图片查看器实现
- JQuery日期插件datepicker的使用
- jquery-barcode:js实现的条码打印
- 聊聊jQuery的反模式
- Jquery 将表单序列化为Json对象.同时提交多个表单的参数
- 两种方式解决jquery Ajax 发送中文乱码的方法,
- jQuery UI Dialog 参数使用
- 编写jQuery插件---简单总结
- jquery 点击同一个按钮,第一次与第二次执行不同事件
- jQuery基础教程-第8章-004完整代码
- jQuery基础教程-第8章-003Providing flexible method parameters