我有一个类似的问题
http://forum.jquery.com/topic/jqm-1-0a3-dialog-url-state-appears-in-history
我正在使用photoswipe + jquerymobile + phonegap,问题是当画廊加载时,如果我转到另一个页面并单击后退按钮,我点击任何图像,现在从这里进入轮播模式,这发生在网址的末尾浏览器地址栏
&ui-state=对话框
但它不会回到轮播模式。所以当我再次单击返回按钮时,它会将我带到画廊页面,跳过轮播模式。
我有一个类似的问题
http://forum.jquery.com/topic/jqm-1-0a3-dialog-url-state-appears-in-history
我正在使用photoswipe + jquerymobile + phonegap,问题是当画廊加载时,如果我转到另一个页面并单击后退按钮,我点击任何图像,现在从这里进入轮播模式,这发生在网址的末尾浏览器地址栏
但它不会回到轮播模式。所以当我再次单击返回按钮时,它会将我带到画廊页面,跳过轮播模式。
您需要做两件事:1)从 body 标签中删除 ps-active 类 2)找到所有 photoswipe 实例并取消设置它们
以下代码对我有用:
$(document).bind('pagebeforechange', function(e) {
if ($('.ps-carousel').length) {
$('body').removeClass('ps-active');
$('div.gallery-page').each(function(){
var photoSwipe = window.Code.PhotoSwipe;
var photoSwipeInstance = photoSwipe.getInstance($(this).attr('id'));
if (typeof photoSwipeInstance != "undefined" && photoSwipeInstance != null) {
photoSwipe.unsetActivateInstance(photoSwipeInstance);
}
});
}
});
请查看此链接以获取更多信息。