0
我有多個PhotoSwipe畫廊從列表中完美地在桌面上工作的投資組合,但只有第一個畫廊在移動設備上顯示它的圖像,而後續畫廊則沒有。 PhotoSwipe實例實例化,我可以使用箭頭等導航,但沒有圖像..任何想法? (我使用rel = 「外部」 試圖無濟於事)多個Photoswipe畫廊移動
的photoswipe代碼:
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-->