Quantcast
Channel: Shiitake's tumblr.
Viewing all articles
Browse latest Browse all 46471

"Page initialization events Internally, jQuery Mobile auto-initializes plugins based on the..."

$
0
0

Page initialization events

Internally, jQuery Mobile auto-initializes plugins based on the markup conventions found in a given “page”. For example, an input element with a type of range will automatically generate a custom slider control.

This auto-initialization is controlled by the “page” plugin, which dispatches events before and after it executes, allowing you to manipulate a page either pre-or-post initialization, or even provide your own intialization behavior and prevent the auto-initializations from occuring. Note that these events will only fire once per “page”, as opposed to the show/hide events, which fire every time a page is shown and hidden.

pagebeforecreate
Triggered on the page being initialized, before initialization occurs.
pagecreate
Triggered on the page being initialized, after initialization occurs.
		
$('#aboutPage').live('pagebeforecreate',function(event){
  alert('This page was just inserted into the dom!');
});

$('#aboutPage').live('pagecreate',function(event){
  alert('This page was just enhanced by jQuery Mobile!');
});
		
		


- jQuery Mobile: Demos and Documentation

Viewing all articles
Browse latest Browse all 46471

Trending Articles