forked from tavicu/bs-confirmation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
executable file
·51 lines (42 loc) · 1.76 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
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap-Confirmation Demo</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div>
<h1>Default options with datta toggle</h1>
<pre><a href="http://www.google.com" class="btn btn-default" data-toggle="confirmation">Click me</a>
$('[data-toggle="confirmation"]').confirmation();</pre>
<a href="http://www.google.com" class="btn btn-default" data-toggle="confirmation">Click me</a>
</div>
<div>
<h1>With callback functions</h1>
<pre><a href="#confirm" class="btn btn-default confirmation-callback">Click me</a>
$('.confirmation-callback').confirmation({
onConfirm: function(event, element) { alert('confirm') },
onCancel: function(event, element) { alert('cancel') }
});</pre>
<a href="#confirm" class="btn btn-default confirmation-callback">Click me</a>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.js"></script>
<script src="bootstrap-confirmation.min.js"></script>
<script>
$(function() {
$('body').confirmation({
selector: '[data-toggle="confirmation"]'
});
$('.confirmation-callback').confirmation({
onConfirm: function(event, element) { alert('confirm') },
onCancel: function(event, element) { alert('cancel') }
});
});
</script>
</body>
</html>