Configuring jQuery Mobile
jQuery Mobile does many things for you—from improving page navigation to changing how form controls work. All of this is done in an effort to make your content work better in a mobile environment. There will be times, however, when you would not want jQuery Mobile to do something, or perhaps, you would simply want to slightly tweak how the framework acts. That's where configuration comes in.
To configure a jQuery Mobile website, you begin by writing a code that listens for the mobileinit
event. This can be done using a normal jQuery event handler similar to the following code snippet:
$(document).bind("mobileinit", function() { //your customization here });
For this event to be captured, you must configure it before jQuery Mobile is actually loaded. The simplest way to do this, and the way recommended by the jQuery Mobile documents, is simply placing this code in a script loaded before the jQuery Mobile JavaScript library. The following code snippet shows what the...