Triggering jQuery Mobile page events can be helpful when building dynamic pages. For instance, if you add several new components to a page you can call the create event to enhance all new widgets on the page at once.
- trigger(“create”)We can trigger this event to automatically enhance all new elements on a page. This event is triggered on the page container.Example:
// Add two new buttons to the page
$( '<button id="b2">Button2</button>' ).insertAfter( "#b1" );
$( '<button id="b3">Button3</button>' ).insertAfter( "#b2" );
// Enhance the new buttons on the page
$.mobile.pageContainer.trigger( "create" );
Leave a Reply