我正在使用帶有jQuery Mobile的Photoswipe圖庫。點擊時的第一個選擇只顯示帶有完整URL的圖像,不能以圖庫的方式工作。當我回去並再次選擇時,它工作正常。在第一次失敗/刷新頁面後,ps正在工作。PhotoSwipe在第一次加載頁面時不起作用
請檢查以下鏈接,它是我的移動網站。 http://w3qatar.info/aldarmobi
當我們檢查鏈接屬性>從列表中的任何屬性>查看更多的照片...在這個你可以找到縮略圖。當我們首先點擊縮略圖時,它會加載原始圖像而不是圖庫視圖。但是當我們返回並重試時,它將起作用。我正在使用Opera移動模擬器進行測試。帶有Mobile_jquery主題的Drupal 7。本站使用jquery mobile。
內部代碼:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<link href="http://w3qatar.info/aldarmobi/sites/all/themes/mobile_jquery/photoswipe.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://w3qatar.info/aldarmobi/sites/all/themes/mobile_jquery/lib/klass.min.js"></script>
<script type="text/javascript" src="http://w3qatar.info/aldarmobi/sites/all/themes/mobile_jquery/scripts/code.photoswipe.jquery-3.0.5.min.js"></script>
<script type="text/javascript">
(function(window, PhotoSwipe){
document.addEventListener('DOMContentLoaded', function(){
var
options = {},
instance = PhotoSwipe.attach(window.document.querySelectorAll('#gallery li a'), options);
}, false);
}(window, window.Code.PhotoSwipe));
</script>
HTML的一部分:
<ul id="gallery" class="gallery">
<li><a href="imageurl1" rel="external"><img src="imageurl1" alt="image name1" /></a></li>
<li><a href="imageurl2" rel="external"><img src="imageurl2" alt="image name2" /></a></li>
<li><a href="imageurl3" rel="external"><img src="imageurl3" alt="image name3" /></a></li>
<li><a href="imageurl4" rel="external"><img src="imageurl4" alt="image name4" /></a></li>
</ul
你能幫幫我嗎? 我想在iPhone設備和Android手機上工作。
在此先感謝。
harikris。
有時候,我找到了新的錯誤「未捕獲的異常:Code.PhotoSwipe.createInstance:無圖像傳遞」。 – Harikrishnan