-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
debug-jquery-mobile.html
182 lines (130 loc) · 7.24 KB
/
debug-jquery-mobile.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
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
<!DOCTYPE html><html>
<head>
<title>PhotoSwipe</title>
<meta name="author" content="Code Computerlove - http://www.codecomputerlove.com/" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="../lib/jquery.mobile-1.0b2/jquery.mobile-1.0b2.min.css" rel="stylesheet" />
<link href="jquery-mobile.css" type="text/css" rel="stylesheet" />
<link href="../assets/photoswipe.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../lib/klass.min.js"></script>
<script type="text/javascript" src="../lib/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../lib/jquery.mobile-1.0b2/jquery.mobile-1.0b2.min.js"></script>
<script type="text/javascript" src="../code.util/util.js"></script>
<script type="text/javascript" src="../code.util/browser.js"></script>
<script type="text/javascript" src="../code.util/dom.jquery.js"></script>
<script type="text/javascript" src="../code.util/events.jquery.js"></script>
<script type="text/javascript" src="../code.util/animation.js"></script>
<script type="text/javascript" src="../code.photoswipe/touchelement.js"></script>
<script type="text/javascript" src="../code.photoswipe/touchelement.class.js"></script>
<script type="text/javascript" src="../code.photoswipe/image.js"></script>
<script type="text/javascript" src="../code.photoswipe/image.class.js"></script>
<script type="text/javascript" src="../code.photoswipe/cache.js"></script>
<script type="text/javascript" src="../code.photoswipe/cache.class.js"></script>
<script type="text/javascript" src="../code.photoswipe/documentoverlay.js"></script>
<script type="text/javascript" src="../code.photoswipe/documentoverlay.class.js"></script>
<script type="text/javascript" src="../code.photoswipe/carousel.js"></script>
<script type="text/javascript" src="../code.photoswipe/carousel.class.js"></script>
<script type="text/javascript" src="../code.photoswipe/carousel.class.animation.js"></script>
<script type="text/javascript" src="../code.photoswipe/toolbar.js"></script>
<script type="text/javascript" src="../code.photoswipe/toolbar.class.js"></script>
<script type="text/javascript" src="../code.photoswipe/uilayer.js"></script>
<script type="text/javascript" src="../code.photoswipe/uilayer.class.js"></script>
<script type="text/javascript" src="../code.photoswipe/zoompanrotate.js"></script>
<script type="text/javascript" src="../code.photoswipe/zoompanrotate.class.js"></script>
<script type="text/javascript" src="../code.photoswipe/photoswipe.js"></script>
<script type="text/javascript" src="../code.photoswipe/photoswipe.class.js"></script>
<script type="text/javascript">
/*
* IMPORTANT!!!
* REMEMBER TO ADD rel="external" to your anchor tags.
* If you don't this will mess with how jQuery Mobile works
*/
(function(window, $, PhotoSwipe){
$(document).ready(function(){
$('div.gallery-page').live('pageshow', function(e){
// See if there is a PhotoSwipe instance associated with the page.
// For this demo I've assumed one page has one instance and the ID
// for each instance is the same as the page ID.
//
// Of course, it's up to you how many instances per page and what
// ID naming convention you use!
var
currentPage = $(e.target),
photoSwipeInstanceId = currentPage.attr('id'),
photoSwipeInstance = PhotoSwipe.getInstance(photoSwipeInstanceId)
options = {};
if (typeof photoSwipeInstance === "undefined" || photoSwipeInstance === null) {
console.log('creating');
photoSwipeInstance = $("ul.gallery a", e.target).photoSwipe(options, photoSwipeInstanceId);
}
return true;
})
});
}(window, window.jQuery, window.Code.PhotoSwipe));
</script>
</head>
<body>
<div data-role="page" id="Home">
<div data-role="header">
<h1>PhotoSwipe</h1>
</div>
<div data-role="content" >
<p>These examples show PhotoSwipe integrated with jQuery Mobile:</p>
<ul data-role="listview" data-inset="true">
<li><a href="#Gallery1">First Gallery</a></li>
<li><a href="#Gallery2">Second Gallery</a></li>
</ul>
<p>PhotoSwipe has also been designed to run stand-alone and can be easily integrated into your non jQuery / jQuery mobile websites:</p>
<ul data-role="listview" data-inset="true">
<li><a href="http://m.codecomputerlove.com/flickr-uploads/default.aspx" target="_blank">Code Computerlove</a></li>
</ul>
</div>
<div data-role="footer">
<h4>© %%year%% Code Computerlove</h4>
</div>
</div>
<div data-role="page" data-add-back-btn="true" id="Gallery1" class="gallery-page">
<div data-role="header">
<h1>First Gallery</h1>
</div>
<div data-role="content">
<ul class="gallery">
<li><a href="images/full/001.jpg" rel="external"><img src="images/thumb/001.jpg" alt="Image 001" /></a></li>
<li><a href="images/full/002.jpg" rel="external"><img src="images/thumb/002.jpg" alt="Image 002" /></a></li>
<li><a href="images/full/003.jpg" rel="external"><img src="images/thumb/003.jpg" alt="Image 003" /></a></li>
<li><a href="images/full/004.jpg" rel="external"><img src="images/thumb/004.jpg" alt="Image 004" /></a></li>
<li><a href="images/full/005.jpg" rel="external"><img src="images/thumb/005.jpg" alt="Image 005" /></a></li>
<li><a href="images/full/006.jpg" rel="external"><img src="images/thumb/006.jpg" alt="Image 006" /></a></li>
<li><a href="images/full/007.jpg" rel="external"><img src="images/thumb/007.jpg" alt="Image 007" /></a></li>
<li><a href="images/full/008.jpg" rel="external"><img src="images/thumb/008.jpg" alt="Image 008" /></a></li>
<li><a href="images/full/009.jpg" rel="external"><img src="images/thumb/009.jpg" alt="Image 009" /></a></li>
</ul>
</div>
<div data-role="footer">
<h4>© %%year%% Code Computerlove</h4>
</div>
</div>
<div data-role="page" data-add-back-btn="true" id="Gallery2" class="gallery-page">
<div data-role="header">
<h1>Second Gallery</h1>
</div>
<div data-role="content">
<ul class="gallery">
<li><a href="images/full/010.jpg" rel="external"><img src="images/thumb/010.jpg" alt="Image 010" /></a></li>
<li><a href="images/full/011.jpg" rel="external"><img src="images/thumb/011.jpg" alt="Image 011" /></a></li>
<li><a href="images/full/012.jpg" rel="external"><img src="images/thumb/012.jpg" alt="Image 012" /></a></li>
<li><a href="images/full/013.jpg" rel="external"><img src="images/thumb/013.jpg" alt="Image 013" /></a></li>
<li><a href="images/full/014.jpg" rel="external"><img src="images/thumb/014.jpg" alt="Image 014" /></a></li>
<li><a href="images/full/015.jpg" rel="external"><img src="images/thumb/015.jpg" alt="Image 015" /></a></li>
<li><a href="images/full/016.jpg" rel="external"><img src="images/thumb/016.jpg" alt="Image 016" /></a></li>
<li><a href="images/full/017.jpg" rel="external"><img src="images/thumb/017.jpg" alt="Image 017" /></a></li>
<li><a href="images/full/018.jpg" rel="external"><img src="images/thumb/018.jpg" alt="Image 018" /></a></li>
</ul>
</div>
<div data-role="footer">
<h4>© %%year%% Code Computerlove</h4>
</div>
</div>
</body>
</html>