Check

功能描述

拖动验证,用例见 check.html。

效果图

Check - 图1

依赖的模块

swiper.min.js rem.js jquery.min.js

快速使用

js 调用

  1. <script>
  2. var btn1 = document.getElementById("btn1");
  3. var btn2 = document.getElementById("btn2");
  4. var btn3 = document.getElementById("btn3");
  5. var result1 = document.getElementById("result1");
  6. var result2 = document.getElementById("result2");
  7. var result3 = document.getElementById("result3");
  8. var slider1 = new FtSlider({
  9. id: "slider1",
  10. callback: function(res) {
  11. result1.innerHTML = res;
  12. }
  13. });
  14. var slider2 = new FtSlider({
  15. id: "slider2",
  16. width: 320,
  17. height: 36,
  18. textMsg: "拖动滑块到右边",
  19. successMsg: "验证成功了哦",
  20. callback: function(res) {
  21. result2.innerHTML = res;
  22. }
  23. });
  24. var slider3 = new FtSlider({
  25. id: "slider3",
  26. width: "100%",
  27. height: "100%",
  28. callback: function(res) {
  29. result3.innerHTML = res;
  30. }
  31. });
  32. btn1.onclick = function() {
  33. slider1.restore();
  34. result1.innerHTML = "false";
  35. }
  36. btn2.onclick = function() {
  37. slider2.restore();
  38. result2.innerHTML = "false";
  39. }
  40. btn3.onclick = function() {
  41. slider3.restore();
  42. result3.innerHTML = "false";
  43. }
  44. </script>

特别说明

拖动验证,见用例 check.html。