拖动验证,用例见 check.html。
swiper.min.js rem.js jquery.min.js
js 调用
<script>
var btn1 = document.getElementById("btn1");
var btn2 = document.getElementById("btn2");
var btn3 = document.getElementById("btn3");
var result1 = document.getElementById("result1");
var result2 = document.getElementById("result2");
var result3 = document.getElementById("result3");
var slider1 = new FtSlider({
id: "slider1",
callback: function(res) {
result1.innerHTML = res;
}
});
var slider2 = new FtSlider({
id: "slider2",
width: 320,
height: 36,
textMsg: "拖动滑块到右边",
successMsg: "验证成功了哦",
callback: function(res) {
result2.innerHTML = res;
}
});
var slider3 = new FtSlider({
id: "slider3",
width: "100%",
height: "100%",
callback: function(res) {
result3.innerHTML = res;
}
});
btn1.onclick = function() {
slider1.restore();
result1.innerHTML = "false";
}
btn2.onclick = function() {
slider2.restore();
result2.innerHTML = "false";
}
btn3.onclick = function() {
slider3.restore();
result3.innerHTML = "false";
}
</script>
拖动验证,见用例 check.html。