forked from tommcfarlin/Simple-Overlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite.js
62 lines (59 loc) · 1.45 KB
/
site.js
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
$(function() {
$('#paragraph-trigger').click(function() {
$(this).overlay({
closeOnClick: true
});
});
$('#anchor-trigger').click(function(evt) {
evt.preventDefault();
$(this).overlay({
color: 'red',
closeOnClick: true,
glossy: true
});
});
$('#modal-trigger').click(function(evt) {
evt.preventDefault();
$(this).overlay({
effect: 'fade',
opacity: 0.8,
onShow: function() {
$('body').append(
$('<div id="modal">This is my modal. Click to close it.</div>')
.css({
background: '#fff',
zIndex: 3000,
padding: '10px',
width: '640px',
height: '240px',
margin: '0 auto',
opacity: 1,
position: 'absolute',
top: '10%',
left: '10%'
}).click(function() {
$(this).remove();
$('.overlay:first').fadeOut('fast', function() {
$(this).remove();
});
})
);
}
});
});
$('#photo-trigger').click(function() {
$(this).overlay({
color: '#ccc',
effect: 'fade',
glossy: true,
container: '#photo-trigger',
onShow: function() {
$(this).click(function(evt) {
evt.preventDefault();
}).bind('contextmenu', function(evt) {
evt.preventDefault();
});
}
});
});
});