-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
76 lines (74 loc) · 2.27 KB
/
index.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>AlertView Demo</title>
<link rel="stylesheet" type="text/css" href="alertview.css"/>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="alertview.js"></script>
<script type="text/javascript">
$(function() {
$('#show-popup-link-1').bind('click', function(evt) {
evt.preventDefault();
AlertView.show({
title: 'Hello',
message: 'This is an AlertView!',
buttons: ['OK'],
callback: function(index) {
console.log('Button was clicked!');
}
});
});
$('#show-popup-link-2').bind('click', function(evt) {
evt.preventDefault();
AlertView.show({
title: 'Hello',
message: 'This is an AlertView!',
buttons: ['OK', 'Cancel'],
callback: function(index) {
switch (index) {
case 0:
console.log('Ok was clicked!');
break;
case 1:
console.log('Cancel was clicked!');
break;
default:
break;
}
}
});
});
$('#show-popup-link-3').bind('click', function(evt) {
evt.preventDefault();
AlertView.show({
title: 'Hello',
message: 'This is an AlertView!',
buttons: ['Button 1', 'Button 2', 'Cancel'],
callback: function(index) {
switch (index) {
case 0:
console.log('Button 1 was clicked!');
break;
case 1:
console.log('Button 2 was clicked!');
break;
case 2:
console.log('Cancel was clicked!');
break;
default:
break;
}
}
});
});
});
</script>
</head>
<body>
<a id="show-popup-link-1" href="#">Show popup with one button</a><br>
<a id="show-popup-link-2" href="#">Show popup with two buttons</a><br>
<a id="show-popup-link-3" href="#">Show popup with three buttons</a>
</body>
</html>