-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
111 lines (98 loc) · 4.94 KB
/
test.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
105
106
107
108
109
110
111
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Proto Gallery Test</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="../proto-dialog-js/proto-dialog.css"/>
<script src="../proto-dialog-js/jquery.proto-dialog.js"></script>
<link rel="stylesheet" type="text/css" href="proto-gallery.css"/>
<script type="text/javascript" src="jquery.proto-gallery.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#proto-gallery-static').protoGallery({
'source' : 'selector',
'selector': {
'slide': 'a',
'thumbnail': 'img[src]',
'photo': '[data-photo]',
'title': 'img[alt]',
'description': 'div',
'link': '[href]'
}
});
$('#open-gallery').on('click', function () {
$('#proto-gallery-static').protoGallery('open');
});
$('#load-gallery-1').on('click', function () {
$('body').protoGallery('open', {
'source' : 'collection',
'collection': [
{
'photo': 'http://dev.wordpress/wp-content/uploads/2015/06/18360343026_1ee8e276d0_k.jpg'
},
{
'photo': 'http://dev.wordpress/wp-content/uploads/2015/06/18206393669_4e469f2af3_k.jpg'
}
]
});
});
$('#load-gallery-2').on('click', function () {
$('body').protoGallery('open', {
'source' : 'query',
'query': '#proto-gallery-source a'
});
});
});
</script>
<style>
body { text-align: center; }
button { background-color: #efefef; color: #333; border: none; padding: 10px 20px; }
button:hover { background-color: #fafafa; }
.gallery > * {
display: inline-block; width: 100px; height: 100px; margin-left: 10px; margin-bottom: 10px;
}
.gallery > * img {
max-width: 100%; max-height: 100%;
}
</style>
</head>
<body>
<h1>prodo-dialog-js</h1>
<h2>Fixed Gallery</h2>
<div id="proto-gallery-static" class="gallery">
<a href="" data-photo="http://dev.wordpress/wp-content/uploads/2015/06/18360343026_1ee8e276d0_k.jpg">
<img src="http://dev.wordpress/wp-content/uploads/2015/06/18360343026_1ee8e276d0_k.jpg" />
</a>
<a href="" data-photo="http://dev.wordpress/wp-content/uploads/2015/06/18206393669_4e469f2af3_k.jpg">
<img src="http://dev.wordpress/wp-content/uploads/2015/06/18360343026_1ee8e276d0_k.jpg" />
</a>
<a href="" data-photo="http://dev.wordpress/wp-content/uploads/2015/06/18387880391_d585dba460_k.jpg">
<img src="http://dev.wordpress/wp-content/uploads/2015/06/18360343026_1ee8e276d0_k.jpg" />
</a>
<a href="" data-photo="http://dev.wordpress/wp-content/uploads/2015/06/18212701859_cd02c47b66_h.jpg">
<img src="http://dev.wordpress/wp-content/uploads/2015/06/18360343026_1ee8e276d0_k.jpg" />
</a>
</div>
<button id="open-gallery" type="button">Open Gallery</button>
<h2>Dynamic Gallery</h2>
<div id="proto-gallery-source" class="gallery">
<a href="" data-photo="http://dev.wordpress/wp-content/uploads/2015/06/18387880391_d585dba460_k.jpg">
<img src="http://dev.wordpress/wp-content/uploads/2015/06/18360343026_1ee8e276d0_k.jpg" />
</a>
<a href="" data-photo="http://dev.wordpress/wp-content/uploads/2015/06/18212701859_cd02c47b66_h.jpg">
<img src="http://dev.wordpress/wp-content/uploads/2015/06/18360343026_1ee8e276d0_k.jpg" />
</a>
</div>
<div id="proto-gallery-dynamic">
<button id="load-gallery-1" type="button">Load External - Collection</button>
<button id="load-gallery-2" type="button">Load External - Query</button>
</div>
</body>
</html>