zoukankan      html  css  js  c++  java
  • 前端用verify.js写验证码(普通、滑动、点选验证码)

    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
        <link rel="stylesheet" href="verify.css">
        <script src="./js/jquery.min.js"></script>
        <script src="./js/verify.js"></script>
      </head>
      <body>
        <div id="demo"></div>
        <script>
          $("#demo").slideVerify({
            type: 2, //类型
            vOffset: 5, //误差量,根据需求自行调整
            vSpace: 5, //间隔
            imgName: ["1.jpg", "2.jpg"],// 填写需要的图片
            imgSize: {
               "400px",
              height: "200px",
            },
            blockSize: {
               "40px",
              height: "40px",
            },
            barSize: {
               "400px",
              height: "40px",
            },
            ready: function () {
                alert('刚开始执行')
            },
            success: function () {
              alert("验证成功,添加你自己的代码!");
            },
            error: function () {
              alert('哈哈哈哈,错了!')
            },
          });
        </script>
      </body>
    </html>

    具体参考这个链接,写的相当好:https://www.html5tricks.com/demo/jquery-front-end-verify/index.html
    需要引入verify.js和verify.css(下附下载地址):
    https://blog-static.cnblogs.com/files/lyt520/verify.js
    https://blog-static.cnblogs.com/files/lyt520/verify.css
  • 相关阅读:
    中国石油大学天梯赛真题模拟第二场
    AtCoder Grand Contest 016 B
    POJ1011 Sticks
    UPC7817: Supermarket
    UPC5652: Ants on a Circle
    石大iCal课表使用指南
    UPC10582: Cowpatibility
    UPC11079: 小P的决斗 POJ3244 Difference between Triplets
    UPC6976:矩阵模板(二维哈希)
    知识点2-3:视图的职责
  • 原文地址:https://www.cnblogs.com/lyt520/p/14699964.html
Copyright © 2011-2022 走看看