jquerymobile pageShow , PrevPage

被刻印的时光 ゝ 提交于 2019-12-24 11:06:49

问题


I have 3 JqueryMobile pages:

Page1,Page2 and Page3

every one can navigate to Page3, I'm using this code:

        $('#Page3').on('pageshow', function (object) {
            //  Change enabled status 
            $('#MenuItemEnPedido').find('a').each(function () {
                $(this).addClass('ui-disabled');
            });
            $('#PagDocumentoOpcionDetalle').removeClass('ui-disabled');
        });

To change some options, but i need to know the id of object page returned by pageshow event. Not target id, just prevPage Id.


回答1:


This is an example how to retrieve last page data from jQM: http://jsfiddle.net/Gajotres/mfC8j/

During pagebeforeshow event you can access last page data and use it for next one:

$('#page2').on('pagebeforeshow', function (e, data) {
    alert(data.prevPage.attr('id'));
});

prevPage is an object that contains whole last page.



来源:https://stackoverflow.com/questions/13793846/jquerymobile-pageshow-prevpage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!