我在使用 Phonegap 和 PhotoSwipe 时遇到问题;我想调用一个包含照片库的 ajax 页面;但在这种情况下,PhotoSwipe 不起作用。这似乎很容易。
谢谢您的帮助
亨利
这是我的 Javascript:
$(document).on('pageshow','#photo', function(){
console.log("photo1");
(function(window, $, PhotoSwipe){
$(document).ready(function(){
var options = {};
$("#Gallery a").photoSwipe(options);
});
}(window, window.jQuery, window.Code.PhotoSwipe));
});
这是简单的html:
<!-- Start of page - GALLERY -->
<div data-role="page" id="photo">
<div data-role="header" data-theme="b" data-position="fixed">
<a href="#page4" data-icon="arrow-l" data-transition="slide" data-direction="reverse">Back</a><h1>ABC</h1>
</div><!-- /header -->
<div data-role="content">
<ul id="Gallery" class="gallery">
<li><a href="/img/page/155/icon4.jpg" rel="external"><img src=""/img/page/155/icon.jpg" alt="Image 005" /></a></li>
<li><a href="/img/page/155/icon4.jpg" rel="external"><img src=""/img/page/155/icon.jpg" alt="Image 006" /></a></li>
<li><a href="/img/page/155/icon4.jpg" rel="external"><img src=""/img/page/155/icon.jpg" alt="Image 007" /></a></li>
<li><a href="/img/page/155/icon4.jpg" rel="external"><img src=""/img/page/155/icon.jpg" alt="Image 008" /></a></li>
<li><a href="/img/page/155/icon4.jpg" rel="external"><img src=""/img/page/155/icon.jpg" alt="Image 009" /></a></li>
<li><a href="/img/page/155/icon4.jpg" rel="external"><img src="/img/page/155/icon.jpg" alt="Image 010" /></a></li>
</ul>
</div><!-- /content -->
</div><!-- /page -->