写真スワイプ ギャラリーは正常に動作しますが、問題は 1 つだけです。
ケース 1: #about で #gallery に入った後、写真をクリックして表示し、閉じて、戻るボタンを押すと #about に移動します。#about には、表示可能なポップアップ イメージが含まれています。このようにして、すべてが正常に機能します
ケース 2: #about で #gallery に入ると、利用可能なすべての写真があります。しかし、クリックせずに戻るボタンを押すだけで、#about ポップアップが表示されませんが、ブラウザーの URL は URL に &ui-state=dialog を追加します。
これは非常に奇妙です。これが私の写真スワイプjsコードです:
(function(window, $, PhotoSwipe){
$(document).ready(function(){
$('div.gallery-page')
.live('pageshow', function(e){
var
currentPage = $(e.target),
options = {},
photoSwipeInstance = $("ul.gallery a", e.target).photoSwipe(options, currentPage.attr('id'));
return true;
})
.live('pagehide', function(e){
var
currentPage = $(e.target),
photoSwipeInstance = PhotoSwipe.getInstance(currentPage.attr('id'));
if (typeof photoSwipeInstance != "undefined" && photoSwipeInstance != null) {
PhotoSwipe.detatch(photoSwipeInstance);
}
return true;
});
});
}(window, window.jQuery, window.Code.PhotoSwipe));
の
$('#galleryContent').append('<li><a href="XXX" rel="external"><img src="XXX" width="150" /></a></li>');
これはギャラリーです:
<div data-role="page" id="gallery" class="gallery-page" data-add-back-btn="true">
<div data-role="header" data-theme="b">
<h1>Images</h1>
</div>
<div data-role="content" data-theme="a">
<ul class="gallery" id="galleryContent">
</ul>
</div>
<div data-role="footer" data-theme="b">
<h4>xxx</h4>
</div>