Jquery mobile Photosweep库中的第一个选择无效

Jquery mobile Photosweep库中的第一个选择无效,jquery-mobile,photoswipe,Jquery Mobile,Photoswipe,我正在使用带有jQuery Mobile的Photosweep gallery。单击/点击第一个选项时,仅显示带有完整URL的图像,而不以画廊的方式工作。当我返回并再次选择时,它工作正常 谁能告诉我怎么解决这个问题吗 干杯 当用户直接使用链接Photosweep进入Photosweep库页面时,Photosweep未初始化。例如,即使使用直接链接进行官方演示,也会导致此问题。链接: 尝试将Photoswip为pageshow和pagehide事件附加处理程序的脚本放在jquery mobile.

我正在使用带有jQuery Mobile的Photosweep gallery。单击/点击第一个选项时,仅显示带有完整URL的图像,而不以画廊的方式工作。当我返回并再次选择时,它工作正常

谁能告诉我怎么解决这个问题吗


干杯

当用户直接使用链接Photosweep进入Photosweep库页面时,Photosweep未初始化。例如,即使使用直接链接进行官方演示,也会导致此问题。链接:

尝试将Photoswip为
pageshow
pagehide
事件附加处理程序的脚本放在
jquery mobile.js
之前。若处理程序在用户第一次访问页面时不会被触发,那个么它们将被附加


(功能(窗口,$,Photosweep){
$(文档).ready(函数(){
$('div.gallery-page')
.live('pageshow',功能(e){
如果($('ul.gallery',e.target).length>0){
变量
当前页面=$(e.target),
选项={},
PhotosweepInstance=$(“ul.gallery a”,e.target).Photosweep(选项,currentPage.attr('id'));
返回true;
}
})
.live('pagehide',函数(e){
如果($('ul.gallery',e.target).length>0){
变量
当前页面=$(e.target),
PhotosweepInstance=Photosweep.getInstance(currentPage.attr('id');
if(类型为PhotosweepInstance!=“未定义”&&PhotosweepInstance!=null){
Photosweep.depatch(Photosweep实例);
}
返回true;
}
});
});
}(window,window.jQuery,window.Code.photoswip));

当用户直接使用链接Photosweep进入Photosweep库页面时,Photosweep未初始化。例如,即使使用直接链接进行官方演示,也会导致此问题。链接:

尝试将Photoswip为
pageshow
pagehide
事件附加处理程序的脚本放在
jquery mobile.js
之前。若处理程序在用户第一次访问页面时不会被触发,那个么它们将被附加


(功能(窗口,$,Photosweep){
$(文档).ready(函数(){
$('div.gallery-page')
.live('pageshow',功能(e){
如果($('ul.gallery',e.target).length>0){
变量
当前页面=$(e.target),
选项={},
PhotosweepInstance=$(“ul.gallery a”,e.target).Photosweep(选项,currentPage.attr('id'));
返回true;
}
})
.live('pagehide',函数(e){
如果($('ul.gallery',e.target).length>0){
变量
当前页面=$(e.target),
PhotosweepInstance=Photosweep.getInstance(currentPage.attr('id');
if(类型为PhotosweepInstance!=“未定义”&&PhotosweepInstance!=null){
Photosweep.depatch(Photosweep实例);
}
返回true;
}
});
});
}(window,window.jQuery,window.Code.photoswip));

这对我来说非常合适。别忘了改编“div.gallery-page”和“ul.gallery”。这对我来说非常合适。别忘了修改“div.gallery-page”和“ul.gallery”。