当前位置: 动力学知识库 > 问答 > 编程问答 >

JQuery Mobile pageinit for Two Pages

问题描述:

I already below for JQM page with id page1:

$('#page1').live('pageinit', function(event, data){

});

If I have another JQM page with id page2 and want to have the same pageinit with page1, how to call it or add the event without copying all the code at page1 pageinit event.

网友答案:

$('#page1,#page2') should do the trick.

Pls refer - http://api.jquery.com/multiple-selector/

网友答案:

I think it will be triggered only once in a multi-page template.

See page load events and page change events: http://jquerymobile.com/test/docs/api/events.html

分享给朋友:
您可能感兴趣的文章:
随机阅读: