1

lazyload 和 jquery mobile 之间的冲突破坏了使用$.mobile.changePage$.mobile.navigate在 phonegap iOS 构建中的预期结果。

虽然它适用于桌面浏览器,但不适用于 iOS 版本(例如那些 phonegap 提供的)。

问题是由这部分代码引起的:

/* With IOS5 force loading images when navigating with back button. */
        /* Non optimal workaround. */
        if ((/iphone|ipod|ipad.*os 5/gi).test(navigator.appVersion)) {
            $window.bind("pageshow", function(event) {
                if (event.originalEvent.persisted) {
                    elements.each(function() {
                        $(this).trigger("appear");
                    });
                }
            });
        }

堆栈跟踪中的问题event.originalEventundefined.

4

1 回答 1

0

以下补丁将解决该问题。但是,这也已在最新版本的插件中得到修复。

if (event.originalEvent && event.originalEvent.persisted) {
    elements.each(function() {
        $(this).trigger("appear");
    });
}
于 2013-08-09T13:48:14.877 回答