From the course: jQuery Mobile Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Configuring jQuery Mobile defaults

Configuring jQuery Mobile defaults - jQuery Mobile Tutorial

From the course: jQuery Mobile Essential Training

Start my 1-month free trial

Configuring jQuery Mobile defaults

Just a couple more things to cover before we wrap up. And one of the things I want to show you is how you can configure some of jQuery Mobile's defaults because in addition to providing some user interface and additional framework capabilities to your apps, jQuery Mobile also exposes an API on itself that you can use to affect how the library operates and performs its functions. Now, to configure jQuery Mobile's defaults, you need to trap the mobileinit event. The mobileinit event is sent when the framework loads, and it fires right away, so you have to define this event handler before you include the library. Essentially what you do is you have your script where you include jQuery and then you have your script down here where you include jQuery Mobile and in between those two is where you define a script that's going to respond to the mobileinit event. So this defines the event handler, and when jQuery Mobile loads, it's going to fire this event right away. So, inside this event…

Contents