This repository has been archived by the owner on Dec 25, 2023. It is now read-only.
forked from electerious/basicContext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjQuery.html
80 lines (58 loc) · 1.84 KB
/
jQuery.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
77
78
79
80
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>basicContext Demo</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css">
<link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" href="../dist/basicContext.min.css">
<link rel="stylesheet" href="../dist/themes/default.min.css">
<style>
html {
width: 100%;
height: 100%;
}
body {
text-align: center;
min-height: 100%;
font-size: 14px;
}
a {
display: inline-block;
margin: 50px 0;
padding: 6px 10px;
background: #4393e6;
color: #fff;
text-decoration: none;
border-radius: 3px;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>
<a href="#" class="click">Click me!</a>
<a href="#" class="context">Right-Click me!</a>
<a href="#" class="touchend">Touch me! (mobile only)</a>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="../dist/basicContext.min.js"></script>
<script>
var onClick = function(e) {
var clicked = function() { alert('Item clicked!') }
var items = [
{ title: 'Add Sites', icon: 'ion-plus-round', fn: clicked },
{ title: 'Reset Login', icon: 'ion-person', fn: clicked },
{ title: 'Help', icon: 'ion-help-buoy', fn: clicked },
{ title: 'Disabled', icon: 'ion-minus-circled', fn: clicked, disabled: true },
{ title: 'Invisible', icon: 'ion-eye-disabled', fn: clicked, visible: false },
{ },
{ title: 'Logout', icon: 'ion-log-out', fn: clicked }
]
basicContext.show(items, e.originalEvent)
}
$(document).ready(function() {
$('.click').on('click', onClick)
$('.context').on('contextmenu', onClick)
$('.touchend').on('touchend', onClick)
})
</script>
</html>