[关闭]
@Wangww0925 2019-08-07T03:24:52.000000Z 字数 852 阅读 201

六位密码输入框

插件


效果图

image_1d1qip7f56e81o1o1tck10dkval9.png-4.6kB

demo下载


使用文档

options 可用参数说明

  1. container - 容器:'#box' | '.box'
  2. focusStyle - 选中样式,默认ff8200【可在css中修改】
  3. len - input的个数,默认6
  4. valText - 显示的内容,默认*
  5. style - 显示input样式【整体样式可在css中修改】
  6. - fontSize - 默认24px
  7. - width - 默认36px
  8. - height - 默认36px
  9. - paddingTop - 默认0px
  10. - ... - 根据自身需求增加

options 内回调函数

  1. blurFun - 失去焦点回调
  2. inputFun - 监听数据变化回调
  3. callback - getEevent 逻辑处理函数回调【该函数中使用 focusblurinput 如要另外增加内容可写在该回调中】

使用步骤

  1. 1 引入 pwdInput.css
  2. 2 引入 pwdInput.js
  3. 3 调用 new pwdInput('#box')

例子:

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Document</title>
  6. <style>
  7. body > div{
  8. width: 500px;
  9. margin: 50px auto;
  10. }
  11. </style>
  12. <link rel="stylesheet" href="pwdInput.css">
  13. </head>
  14. <body>
  15. <div id="box"></div>
  16. <script src="pwdInput.js"></script>
  17. <script>
  18. // 使用
  19. new pwdInput('#box',{
  20. len: 7,
  21. valText: "·",
  22. style:{
  23. paddingTop: '5px'
  24. },
  25. callback: function (){
  26. console.log("事件处理的回调")
  27. }
  28. })
  29. </script>
  30. </body>
  31. </html>

作者 wendy
2019 年 1月 22日

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注