Latest web development tutorials

jQuery Mobile acara pagehide

jQuery Mobile Acara jQuery Mobile Acara

contoh

Setelah beralih halaman lama setelah halaman untuk menyembunyikan beberapa teks pop-up:

$(document).on("pagehide","#pagetwo",function(){
alert("pagehide 事件触发 - 页面二隐藏");
});

Coba »

Definisi dan Penggunaan

Acara pagehide setelah halaman demi halaman beralih pemicu tersembunyi tua.

peristiwa terkait:

  • pagebeforehide - sebelum beralih halaman lama setelah halaman tersembunyi peristiwa pemicu.
  • pagebeforeshow - sebelum menampilkan halaman setelah peristiwa saklar pemicu.
  • pageshow - Setelah menampilkan halaman setelah beralih peristiwa pemicu.

Catatan: acara di setiap halaman Transisi awal ini / stop pemicu.


tatabahasa

Dalam jQuery Halaman Ponsel untuk semua acara memicu:

$("document").on("pagehide",function(event){...}) 尝试一下

Acara pemicu untuk halaman tertentu:

$("document").on("pagehide"," page ",function(event,data){...}) 尝试一下

参数 描述
function(event,data) 必须。 指定 pagehide 事件触发时执行的函数。

该函数含有以下两个参数:

  • 事件对象 - 包括任何jQuery事件属性 ( event.target, event.type 等) 。更多信息请查阅 jQuery 事件参考手册
  • 数据对象 - 包含属性 nextPage, 要返回的过渡页面。
page 可选。 指定 pagehide 事件触发时指向的页面id。 内部页面, 请使用 #id 。外部页面,请使用 externalfile.html


contoh

contoh yang lebih

peristiwa terkait Demo
Contoh ini menunjukkan pagebeforeshow, pageshow, pagebeforehide pagehide dan memicu peristiwa.

benda acara
Menggunakan properti event.timeStamp.

Data Objects
Gunakan Nextpage Halaman transisi pengembalian properti.


jQuery Mobile Acara jQuery Mobile Acara