jQuery Mobile Page beforecreate 事件
jQuery Mobile 是一组基于 jQuery 的基于 HTML5 的用户界面系统,用于开发可在各种屏幕尺寸的设备(如智能手机、平板电脑、台式机和笔记本电脑)上访问的网站。
在本文中,我们将使用 jQuery Mobile 页面beforecreate 在创建页面小部件之前触发的事件。
句法:
使用指定的beforecreate回调初始化页面。
$( ".selector" ).page({
beforecreate: function( event, ui ) {
// Your code here.
}
});
将事件侦听器绑定到pagebeforecreate 事件。
$(".selector").on( "pagebeforecreate", function( event, ui ) {} );
参数:它接受一个有两个参数的回调函数。
- 事件:它接受事件类型值。
- ui:它接受对象类型值。 ui 对象可以为空,但用于与库中的其他事件保持一致。
CDN 链接:
示例:下面的示例演示了页面beforecreate事件的使用。我们将事件监听器绑定到pagebeforecreate 事件触发时打开警报框的事件。
HTML
GeeksforGeeks
jQuery Mobile Page beforecreate event
What is GeekforGeeks?
GeeksforGeeks is a computer science
portal for geeks by geeks. Here
you can find articles on various
computer science topics like Data
Structures, Algorithms and many more.
GeeksforGeeks also provide courses,
you can find the courses at
https://practice.geeksforgeeks.org/courses
For cracking interviews of top product
based companies, you need to
have good and deep understanding of
topics like DSA, System design etc.
GeeksforGeeks provide you quality
content so that you can prepare for
the interviews. GeeksforGeeks also
have a practice portal where you
can practice problems and brush
on your skills. You can visit the
practice portal at
https://practice.geeksforgeeks.org
输出:
参考: https://api.jquerymobile.com/page/#event-beforecreate