//code是后台传入的验证字符串
var code = "jsaidaisd656", codeFn = new moveCode(code);
//获取当前的code值
console.log(codeFn.getCode());
//改变code值
code = '46asd546as5'; codeFn.setCode(code);
//重置为初始状态
codeFn.resetCode();
if (endX > evenWidth * 0.7) { progress.innerText = '验证成功'; progress.style.width = evenWidth + deviation + 'px'; evenBox.style.left = evenWidth + 'px' window.location.href = "这里写你要跳转页面的url地址"; codeInput.value = fn.codeVluae; evenBox.onmousedown = null; } else { alert("验证失败"); progress.style.width = '0px'; evenBox.style.left = '0px'; }
建议加入user-select:none;不然在滑块上选中文字,按住左键,可以向上托