我的作品集列表中有多个 PhotoSwipe 画廊,它们可以在桌面上完美运行,但只有第一个画廊在移动设备上显示其图像,而后续画廊则没有。PhotoSwipe 实例实例化,我可以使用箭头等导航,但没有图像.. 有什么想法吗?(我尝试使用 rel="external" 无济于事)
照片扫码:
function startSwipe(btnId)
{
var galleryName = btnId;
(function(window, PhotoSwipe)
{
var
options = {
preventHide: false,
loop: false,
captionAndToolbarShowEmptyCaptions: false,
getImageSource: function(obj){
return obj.url;
},
getImageCaption: function(obj){
return obj.caption;
}
},
instance = PhotoSwipe.attach(
[
{ url: 'http://www.example.com/gallery/'+galleryName+'/images/0.jpg'},
{ url: 'http://www.example.com/gallery/'+galleryName+'/images/1.jpg'},
{ url: 'http://www.example.com/gallery/'+galleryName+'/images/2.jpg'},
],
options
);
instance.show(0);
}(window, window.Code.PhotoSwipe));
}
和jqm:
<div data-role="content">
<ul data-role="listview" data-theme="a" class="centerLiPort">
<li id="gal1" onClick="startSwipe(this.id)">
<div class="imgDiv"><img src="images/gal1.jpg" ></img></div>
<a>Gallery 1</a>
</li>
<li id="gal2" onClick="startSwipe(this.id)">
<div class="imgDiv"><img src="images/gal2.jpg" ></img></div>
<a>Gallery 2</a>
</li>
<li id="gal3" onClick="startSwipe(this.id)">
<div class="imgDiv" ><img src="images/gal3.jpg" ></img></div>
<a>Gallery 3</a>
</li>
</ul>
</div><!--/content-->