本文介绍了jQuery Mobile-无法将pagebeforechange绑定到页面ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只能将pagebeforechange绑定到整个jquery移动文档,而不能绑定到单个页面.谁能解释为什么不起作用?

I could only ever bind pagebeforechange to the entire jquery mobile document, not an individual page. Can anyone explain why this doesn't work?

推荐答案

$("div[data-role='page']").live( "pagebeforehide", function( event ) {
alert('This alert should trigger before Next Page Here is shown?');
});

(有关详细信息,请查看链接)您还可以使用bind代替live,希望它能对您有所帮助.

(check the link for details)you can also use bind instead of live , Hope it helped.

这篇关于jQuery Mobile-无法将pagebeforechange绑定到页面ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 00:52