-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
239 lines (194 loc) · 10.3 KB
/
index.html
File metadata and controls
239 lines (194 loc) · 10.3 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>jqPhotoSwipe - jQuery for PhotoSwipe by ergec</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<!-- PhotoSwipe Core CSS file -->
<link rel="stylesheet" href="src/PhotoSwipe/photoswipe.css">
<!-- PhotoSwipe Skin CSS file (styling of UI - buttons, caption, etc.)-->
<link rel="stylesheet" href="src/PhotoSwipe/default-skin/default-skin.css">
<!-- PhotoSwipe Core JS file -->
<script src="src/PhotoSwipe/photoswipe.min.js"></script>
<!-- PhotoSwipe UI JS file -->
<script src="src/PhotoSwipe/photoswipe-ui-default.min.js"></script>
<!-- jqPhotoSwipe JS file -->
<script src="src/jqPhotoSwipe.js"></script>
<style type="text/css">
.site-footer-credits {
font-size: 9px;
}
ul {
list-style: none;
margin: 0px;
padding: 0px;
}
.thumb {
width: 150px;
}
</style>
</head>
<body>
<script>
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-46864242-3', 'auto');
ga('send', 'pageview');
</script>
<section class="page-header">
<h1 class="project-name">jqPhotoSwipe - jQuery for PhotoSwipe</h1>
<h2 class="project-tagline">Easy to use jQuery wrapper for PhotoSwipe. No need to image dimensions.</h2>
<a href="https://ergec.github.io" class="btn">Home</a>
<a href="https://github.com/ergec/jQuery-for-PhotoSwipe" class="btn">View on GitHub</a>
<a href="https://github.com/ergec/jQuery-for-PhotoSwipe/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/ergec/jQuery-for-PhotoSwipe/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<h1>
<a id="jquery-wrapper-for-photoswipe" class="anchor" href="#jquery-wrapper-for-photoswipe" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>jQuery Wrapper for <a href="https://github.com/dimsemenov/photoswipe">PhotoSwipe</a>
</h1>
<p>This plugin will allow you to easily transition from your existing fancybox plugin to PhotoSwipe without altering you HTML layout or finding a way define image dimensions. Plugin gets your existing html layout and creates all structure needed for <a href="https://github.com/dimsemenov/photoswipe">PhotoSwipe</a>.</p>
<h2>Key Features</h2>
<ul>
<li><b>Works without image dimensions</b>, you don't have to find a way to get image dimensions, plugin finds them for you.</li>
<li><b>Ultra light</b>, 70 lines of code, 3KB uncompressed, 2KB compressed.</li>
<li><b>Low bandwidth usage</b>, loads original images when needed, not before. Saves bandwidth on limited connections.</li>
<li><b>Supports fancybox</b>, you can easily switch from fancybox to PhotoSwipe</li>
</ul>
<h2>
<a id="usage" class="anchor" href="#usage" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Usage</h2>
<p>Here I used fancybox class but it's up to you to change it.</p>
<h3>
<a id="includes" class="anchor" href="#includes" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Includes</h3>
<pre><code><!-- jQuery -->
<script src="path/to/jquery.min.js"></script>
<!-- PhotoSwipe Core CSS file -->
<link rel="stylesheet" href="path/to/photoswipe.css">
<!-- PhotoSwipe Skin CSS file (styling of UI - buttons, caption, etc.) -->
<link rel="stylesheet" href="path/to/default-skin/default-skin.css">
<!-- PhotoSwipe Core JS file -->
<script src="path/to/photoswipe.min.js"></script>
<!-- PhotoSwipe UI JS file -->
<script src="path/to/photoswipe-ui-default.min.js"></script>
<!-- jqPhotoSwipe JS file -->
<script src="path/to/jqPhotoSwipe.min.js"></script></code></pre>
<h3>
<a id="html" class="anchor" href="#html" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>HTML</h3>
<p><strong>Single Image</strong></p>
<pre><code><a class="fancybox" href="images/01-large.jpg" title="Photo Caption #1" alt="Photo Caption #1"><img src="images/01-thumb.jpg" border="0"></a>
</code></pre>
<p><strong>FancyBox Style Image Gallery</strong></p>
<pre><code>1.
<p>
<a class="fancybox" href="images/01-large.jpg" data-fancybox-group="gallery1" title="Photo Caption #1" alt="Photo Caption #1"><img src="images/01-thumb.jpg" border="0" class="thumb"></a>
<a class="fancybox" href="images/02-large.jpg" data-fancybox-group="gallery1" title="Photo Caption #2" alt="Photo Caption #1"><img src="images/02-thumb.jpg" border="0" class="thumb"></a>
</p>
2.
<p>
<a class="fancybox" href="images/03-large.jpg" data-fancybox-group="gallery2" title="Photo Caption #3" alt="Photo Caption #1"><img src="images/03-thumb.jpg" border="0" class="thumb"></a>
<a class="fancybox" href="images/04-large.jpg" data-fancybox-group="gallery2" title="Photo Caption #4" alt="Photo Caption #1"><img src="images/04-thumb.jpg" border="0" class="thumb"></a>
</p></code></pre>
<p><strong>Forced Image Gallery</strong></p>
<pre><code><div class="forcedgallery">
1.
<p>
<a href="images/01-large.jpg" title="Photo Caption #1" alt="Photo Caption #1"><img src="images/01-thumb.jpg" border="0" class="thumb"></a>
<a href="images/02-large.jpg" title="Photo Caption #2" alt="Photo Caption #1"><img src="images/02-thumb.jpg" border="0" class="thumb"></a>
</p>
2.
<p>
<a href="images/03-large.jpg" title="Photo Caption #3" alt="Photo Caption #1"><img src="images/03-thumb.jpg" border="0" class="thumb"></a>
<a href="images/04-large.jpg" title="Photo Caption #4" alt="Photo Caption #1"><img src="images/04-thumb.jpg" border="0" class="thumb"></a>
</p>
</div></code></pre>
<h3>
<a id="javascript" class="anchor" href="#javascript" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>JavaScript</h3>
<pre>
<code>$(document).ready(function () {
//By default, plugin uses `data-fancybox-group` attribute to create galleries.
$(".fancybox").jqPhotoSwipe({
galleryOpen: function (gallery) {
//with `gallery` object you can access all methods and properties described here http://photoswipe.com/documentation/api.html
//console.log(gallery);
//console.log(gallery.currItem);
//console.log(gallery.getCurrentIndex());
//gallery.zoomTo(1, {x:gallery.viewportSize.x/2,y:gallery.viewportSize.y/2}, 500);
gallery.toggleDesktopZoom();
}
});
//This option forces plugin to create a single gallery and ignores `data-fancybox-group` attribute.
$(".forcedgallery > a").jqPhotoSwipe({
forceSingleGallery: true
});
});</code></pre>
<h3>
Demo
</h3>
<h4>Single Image</h4>
<p>
<a class="fancybox" href="images/01-large.jpg" title="Photo Caption #1" alt="Photo Caption #1">
<img src="images/01-thumb.jpg" border="0" class="thumb">
</a>
</p>
<h4>Fancybox Style Image Galleries</h4>
1.
<p>
<a class="fancybox" href="images/01-large.jpg" data-fancybox-group="gallery1" title="Photo Caption #1" alt="Photo Caption #1"><img src="images/01-thumb.jpg" border="0" class="thumb"></a>
<a class="fancybox" href="images/02-large.jpg" data-fancybox-group="gallery1" title="Photo Caption #2" alt="Photo Caption #1"><img src="images/02-thumb.jpg" border="0" class="thumb"></a>
</p>
2.
<p>
<a class="fancybox" href="images/03-large.jpg" data-fancybox-group="gallery2" title="Photo Caption #3" alt="Photo Caption #1"><img src="images/03-thumb.jpg" border="0" class="thumb"></a>
<a class="fancybox" href="images/04-large.jpg" data-fancybox-group="gallery2" title="Photo Caption #4" alt="Photo Caption #1"><img src="images/04-thumb.jpg" border="0" class="thumb"></a>
</p>
<h4>Single Combined Image Gallery (Forced)</h4>
<div class="forcedgallery">
1.
<p>
<a href="images/01-large.jpg" title="Photo Caption #1" alt="Photo Caption #1"><img src="images/01-thumb.jpg" border="0" class="thumb"></a>
<a href="images/02-large.jpg" title="Photo Caption #2" alt="Photo Caption #1"><img src="images/02-thumb.jpg" border="0" class="thumb"></a>
</p>
2.
<p>
<a href="images/03-large.jpg" title="Photo Caption #3" alt="Photo Caption #1"><img src="images/03-thumb.jpg" border="0" class="thumb"></a>
<a href="images/04-large.jpg" title="Photo Caption #4" alt="Photo Caption #1"><img src="images/04-thumb.jpg" border="0" class="thumb"></a>
</p>
</div>
<script type="text/javascript">
$(document).ready(function() {
$(".fancybox").jqPhotoSwipe({
galleryOpen: function (gallery) {
//with `gallery` object you can access all methods and properties described here http://photoswipe.com/documentation/api.html
//console.log(gallery);
//console.log(gallery.currItem);
//console.log(gallery.getCurrentIndex());
//gallery.toggleDesktopZoom();
}
});
$(".forcedgallery a").jqPhotoSwipe({
forceSingleGallery: true
});
});
</script>
<footer class="site-footer">
<span class="site-footer-owner"><a href="https://github.com/ergec/jQuery-for-PhotoSwipe">jqPhotoSwipe - jQuery for PhotoSwipe</a> is maintained by <a href="https://github.com/ergec">ergec</a>.</span>
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span>
</footer>
</section>
</body>
</html>