?
This document uses PHP Chinese website manual Release
在頁面切換后顯示之前,彈出文本信息:
效果預(yù)覽 ?$(document).on("pagebeforeshow","#pagetwo",function(){
? alert("pagebeforeshow event fired - pagetwo is about to be shown");
});
pagebeforeshow 是在頁面切換后顯示之前,觸發(fā)的事件。
相關(guān)事件:
注意: 該事件在每個過渡頁面開始/停止時觸發(fā)。
To trigger the event for all pages in 在 jQuery Mobile 中為所有頁面觸發(fā)事件:
$("document").on("pagebeforeshow",function(event){...})?實例??
為指定頁面觸發(fā)事件:
$("document").on("pagebeforeshow","page",function(event,data){...})?實例??
參數(shù) | 描述 |
---|---|
function(event,data) | 必須。指定 pagebeforeshow 事件觸發(fā)時執(zhí)行的函數(shù)。 該函數(shù)包含以下兩個參數(shù):
|
page | 可選。 pagebeforeshow 事件指向的頁面id。 內(nèi)部頁面, 請使用 #id。 外部頁面, 使用 externalfile.html。 |
演示相關(guān)事件
該實例演示了 pagebeforeshow, pageshow, pagebeforehide 和 pagehide 事件的觸發(fā)。
事件對象
使用 event.type 屬性返回觸發(fā)的事件類型。
數(shù)據(jù)對象
使用 prevPage 屬性返回過渡的上一個頁面。