指向特定页面Jquery Mobile

时间:2012-09-20 21:49:48

标签: jquery jquery-mobile

在Jquery Mobile 2页面中,在尝试触发此事件时输入DOM(隐藏的一个)

$(document).delegate('div[data-role=page]', 'pagebeforeshow', function (e, data) {

它永远不会开火,我猜是因为这个原因。幸运的是,在我的情况下,两个页面都有不同的ID。如何更改此事件以在id =“AppPage”的页面上触发?

<div data-role="page" data-theme="b" id="AppPage">

1 个答案:

答案 0 :(得分:0)

我想你可能想尝试一下:

$( '#AppPage' ).live( 'pagebeforeshow',function(){
    alert( "Before showing the page AppPage");
});

有关详细信息,请查看在线文档:http://jquerymobile.com/demos/1.1.1/docs/api/events.html

让我知道这就是你要找的东西

相关问题