您好,欢迎来到华佗小知识。
搜索
您的当前位置:首页jquery图形密码实现方法_jquery

jquery图形密码实现方法_jquery

来源:华佗小知识


本文实例讲述了jquery图形密码实现方法。分享给大家供大家参考。具体实现方法如下:

代码如下:

$(document).ready(function() {
var n=0,y=['4','8','12','13','14','15','16'];
for(var i=1;i<=16;i++){
var Box='';
$('#lower').append(Box);
if(i<=4){
$('#box_'+i+'').animate({left:100*i-100+"px"}, 0)
.show(0).delay(i*400-400).animate({width:"90px",height:"90px",top:"300px"}, 800).attr("num",i);
}else if(i<=8){
$('#box_'+i+'').animate({left:100*i-500+"px"}, 0)
.show(0).delay(i*400-400).animate({width:"90px",height:"90px",top:"200px"}, 800).attr("num",i);
}else if(i<=12){
$('#box_'+i+'').animate({left:100*i-900+"px"}, 0)
.show(0).delay(i*400-400).animate({width:"90px",height:"90px",top:"100px"}, 800).attr("num",i);
}else{
$('#box_'+i+'').animate({left:100*i-1300+"px"}, 0)
.show(0).delay(i*400-400).animate({width:"90px",height:"90px",top:"0px"}, 800).attr("num",i);
}
};
$('#lower span').bind("click",function(){
$(this).addClass("select");
var code=$(this).attr("num");
for (var j=0; j if(code==y[j]){
y = jQuery.grep(y, function(n, i){
return (n != code);
});
n=n+1;
}else{
n=n+0;
}
};
if($('.select').length==7){
if(n==7){
$('#lower').empty().append('');
$('#lower a').fadeIn(800);
}else{
$('#page').delay(1000).append('

密码错了,重来吧!

');
$('#tips').slideDown(500).delay(2000).slideUp(500);
$('#lower span').removeClass("select");
n=0;
y=['4','8','12','13','14','15','16'];
}
}
});
});

希望本文所述对大家的jquery程序设计有所帮助。

Copyright © 2019- huatuo0.cn 版权所有 湘ICP备2023017654号-2

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务