Jquerymobile provides many default configurations. jquerymobile will execute the enhancement page element as soon as it is executed, much earlier than document. ready events. These default configurations are suitable for most cases and can be easily modified by developers. When JqueryMobile starts execution, it will trigger
Jquerymobile provides many default configurations. jquerymobile will execute the enhancement page element as soon as it is executed, much earlier than document. ready events. These default configurations are suitable for most cases and can be easily modified by developers.
When Jquery Mobile starts execution, it will trigger the mobileinit event on the document object, so you can bind other behaviors to overwrite the default configuration.
$ (Document). bind ("mobileinit", function (){
// Overwrite the code
});
Because the mobileinit event is triggered immediately after execution, you need to bind your event handler before JqueryMobile loads, so I suggest you arrange your js reference sequence as follows.
Script
Script
Script
Within the event binding, you can set your default configuration, or use the $. extend method of jq to extend the $. mobile object.
$ (Document). bind ("mobileinit", function (){
$. Extend ($. mobile ,{
Foo: bar
});
});
Or set it separately.
$ (Document). bind ("mobileinit", function (){
$. Mobile. foo = bar;
});
Configuration Options
The configurable options and default values of the $. mobile object Section are as follows:
SubPageUrlKey (string, default: "ui-page "):
Url parameters are used to reference subpages generated by the plug-in (for example, subpages generated by nested listview), for example, example.html & ui-page = subpageIdentifir. the Section before & ui-page = is used by the jquery mobile framework to send an ajax request to the URL of the Child page.
NonHistorySelectors (string, default: "dialog "):
For pages with a tag link with a data-rel attribute value or with a data-role attribute value, if they match these selectors (that is, the string parameter ), they will not be tracked in the History (that is, they will not be located in the location. the updated hash is not marked by the browser history ).
ActivePageClass (string, default: "ui-page-active "):
This class is assigned to the page (including the page in the Transition State) in the current view)
ActiveBtnClass (string, default: "ui-page-active "):
This class is used to "Activate" the button status (see the css framework ).
AjaxEnabled (boolean, default: true ):
When possible, jQuery Mobile will automatically process link clicks and form submission through ajax. If not, the url hash listener will stop and the url will send HTTP requests as usual.
AjaxLinksEnabled (boolean, default: true ):
If it is feasible, jQuery Mobile will automatically process the click of a link through ajax.
AjaxFormsEnabled (boolean, default: true ):
JQuery Mobile will automatically process Page Submission through ajax whenever it is feasible.
AutoInitialize (boolean, default: true ):
When this option is set to false, the automatic initialization function will delay the embedded page enhancement function
$. Mobile. initializePage ();
Explicitly called. By default, the page will be enhanced when the DOM is loaded.
DefaultTransition (string, default: 'slide '):
Set the page transition effect (ajax request) and set it to 'None', indicating that no transition effect exists.
LoadingMessage (string, default: "loading "):
Set the text displayed when the page is loaded. If it is set to false, no text will be displayed.
MetaViewportContent (string, default: "width = device-width, minimum-scale = 1, maximum-scale = 1 "):
Configure the automatically generated meta tag. If it is false, no meta tag is added to the DOM.
GradeA (the function returns a boolean value, default: This function returns the $. support. mediaquery value by default ):
True is returned only when the browser meets all supported conditions.