forked from yeild/jigsaw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
62 lines (61 loc) · 1.29 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>滑动拼图验证码</title>
<style>
.container {
width: 310px;
margin: 100px auto;
}
input {
display: block;
width: 290px;
line-height: 40px;
margin: 10px 0;
padding: 0 10px;
outline: none;
border:1px solid #c8cccf;
border-radius: 4px;
color:#6a6f77;
}
#msg {
width: 100%;
line-height: 40px;
font-size: 14px;
text-align: center;
}
a:link,a:visited,a:hover,a:active {
margin-left: 100px;
color: #0366D6;
}
</style>
</head>
<body>
<h3><a href="https://github.com/yeild/jigsaw">返回GitHub</a></h3>
<div class="container">
<input value="admin" readonly/>
<input type="password" value="1234567890" readonly/>
<div id="captcha"></div>
<div id="msg"></div>
</div>
<script>
if (!window.jigsaw) {
document.write('<script src="./dist/jigsaw.min.js"><\/script>')
}
</script>
<script>
jigsaw.init({
el: document.getElementById('captcha'),
onSuccess: function() {
document.getElementById('msg').innerHTML = '登录成功!'
},
onFail: cleanMsg,
onRefresh: cleanMsg
})
function cleanMsg() {
document.getElementById('msg').innerHTML = ''
}
</script>
</body>
</html>