0) ? (endX > evenWidth) ? evenWidth : endX : 0;
if(endX > evenWidth * 0.7){
progress.innerText = '松开验证';
progress.style.backgroundColor = "#66CC66";
}else{
progress.innerText = '';
progress.style.backgroundColor = "#FFFF99";
}
progress.style.width = endX+deviation+'px';
even
Box.style.left = endX+'px';
}
function removeFn() {
document.removeEventListener(
BoxEven['2'],removeFn,false);
document.removeEventListener(
BoxEven['1'],moveFn,false);
if(endX > evenWidth * 0.7){
progress.innerText = '验证成功';
progress.style.width = evenWidth+deviation+'px';
even
Box.style.left = evenWidth+'px'
codeInput.value = fn.codeVluae;
even
Box.onmousedown = null;
_this.ruleForm.verification = true;
}else{
progress.style.width = '0px';
even
Box.style.left = '0px';
}
};
function g
etoffset(
Box,direction){
var setDirection = (direction == 'top') ? 'offsetTop' : 'offsetLeft' ;
var offset =
Box[setDirection];
var parent
Box =
Box.offsetParent;
while(parent
Box){
offset+=parent
Box[setDirection];
parent
Box = parent
Box.offsetParent;
}
parent
Box = null;
return parseInt(offset);
};
even
Box.addEventListener(
BoxEven['0'],function(e) {
e = (
BoxEven['0'] == 'touchstart') ? e.
touches[0] : e || window.event;
goX = e.clientX,offsetLeft = g
etoffset(
Box,'left'),deviation = this.clientWidth,evenWidth =
Box.clientWidth - deviation,endX;
document.addEventListener(
BoxEven['1'],false);
document.addEventListener(
BoxEven['2'],false);
},false);
fn.setCode = function(code){
if(code)
fn.codeVluae = code;
}
fn.getCode = function(){
return fn.codeVluae;
}
fn.resetCode = function(){
even
Box.removeAttribute('style');
progress.removeAttribute('style');
codeInput.value = '';
};
return fn;
}
rush:js;">
.form-inline-input{
border:1px solid #dadada;
border-radius:5px;
}
.form-inline-input input,.code-
Box{
padding: 0 3px;
width: 298px;
height: 40px;
color: #fff;
text-shadow: 1px 1px 1px black;
background: #efefef;
border: 0;
border-radius: 5px;
outline: none;
}
.code-
Box{
position: relative;
}
.code-
Box p,.code-
Box span{
display:block;
position: absolute;
left: 0;
height: 40px;
text-align: center;
line-height: 40px;
border-radius: 5px;
padding:0;
margin:0;
}
.code-
Box span{
width: 40px;
background-color:#fff;
font-size: 16px;
cursor: pointer;
margin-right:1px;
}
.code-
Box p{
width: 0;
background-color: #FFFF99;
overflow: hidden;
text-indent: -20px;
transition: background 1s ease-in;
}
.code-
Box .code-input{
display: none;
}
.code-
Box .code-input{
display: none;
}
.form-inline-input{
border:1px solid #dadada;
border-radius:5px;
}
.form-inline-input input,.code-
Box span{
display:block;
position: absolute;
left: 0;
height: 40px;
text-align: center;
line-height: 40px;
border-radius: 5px;
padding:0;
margin:0;
}
.code-
Box span{
width: 40px;
background-color:#fff;
font-size: 16px;
cursor: pointer;
margin-right:1px;
}
.code-
Box p{
width: 0;
background-color: #FFFF99;
overflow: hidden;
text-indent: -20px;
transition: background 1s ease-in;
}
.code-
Box .code-input{
display: none;
}
.code-
Box .code-input{
display: none;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。