Skip to content

summer25580/jigsaw

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jigsaw

canvas滑动验证码

用法:

  1. 引入jigsaw.js 和 jigsaw.css

jigsaw.init({
  el: document.getElementById('container'),
  onSuccess: function () { ... },
  onFail: function () { ... },
  onRefresh: function () { ... }
})

jigsaw.init接收一个配置对象,el属性为页面容器元素, 后面三个属性分别为验证成功、验证失败和点击刷新按钮后的回调函数。

Tips:

  1. 图片由 https://picsum.photos/ 随机产生,然后使用canvas裁剪生成。

  2. 未编译ES6语法,建议使用现代浏览器体验。

About

canvas滑动验证码

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 66.7%
  • CSS 20.6%
  • HTML 12.7%