-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
104 lines (78 loc) · 3.11 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>sheet plugin</title>
<link href="sheet.css" rel="stylesheet">
</head>
<body>
<h1>jQuery Sheet Plugin</h1>
<p>A small (and well, opinionated) lightbox-style plugin for notifications. A trigger element (can use <a> or href attr or a data attribute on any other element to target local, in-page html and clones it into sheet to display over an overlay. A basic sheet consists of a title and any html content.</p>
<ul>
<li>settings can be html data attributes or as an options object passed via the plugin instantiation</li>
<li>Small js and css files</li>
<li>Support for aria events</li>
<li>One or multiple triggers on a page – each with it's own settings.</li>
<li>Triggers can be anything on the page, including within an active sheet</li>
<li>Uses CSS Transforms for smooth animation</li>
<li>OnOpen and onClose callbacks</li>
<li>tiny to large screens</li>
</ul>
<h2>Examples</h2>
<a class="js-sheet-show" title="title attribute defines sheet title" href="#sheet1">Simple <a> trigger</a> (with classname and href but no plugin assigned)
<br><br>
<a class="js-sheet-show" id="sheet1trigger" href="#sheet1"><a> trigger</a> (href for content, title via plugin assignment)
<br><br>
<button class="js-sheet-show btn--simple" type="button" id="sheet2trigger" data-sheet-content="#sheet2">Button trigger</button>
<span>data-sheet-content attribute and sheet title passed via js</span>
<br><br>
<a href="#trailer-container" id="js-trigger-video" class="js-sheet-show btn--simple" title="Test for video playing on sheet callback">Trailer</a>
<br><br>
<div class="hidden">
<div id="sheet1">
<img src="http://placehold.it/540x225" alt="">
<br>
<a href="#sheet2" class="js-sheet-show">See sheet 2</a>
</div>
<div id="sheet2">
Sheet2 content. Hey, how about <a href="#sheet1" class="js-sheet-show" title="Sheet1 again! (this title on the previous link's title attr. Cool!)">Sheet1 again</a>
</div>
<div id="trailer-container">
<video controls width="100%">
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type="video/mp4"></source>
<source src="http://video-js.zencoder.com/oceans-clip.webm" type="video/webm"></source>
</video>
</div>
</div>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="jquery.sheet.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#sheet1trigger').sheet({
title:'Sheet1 title (overridden by data attr)',
customClass: 'customClass added here'
});
$('#sheet2trigger').sheet({
title:'sheet2 title (via options object)',
customClass: 'sheet--bordered',
onOpen: function() {
console.log('onOpen sheet2');
},
onClose: function() {
console.log('onClose sheet2');
}
});
$('#js-trigger-video').sheet({
customClass: 'video',
autoplayVideo: true,
onOpen: function() {
console.log('onOpen callback for video sheet');
},
onClose: function() {
console.log('onClose callback for video sheet');
}
});
});
</script>
</body>
</html>