Describes the default configuration items of jQuery Mobile, the jQuery Mobile Chinese configuration api, and jQuery Mobile configuration instructions.

Source: Internet
Author: User

I have been learning jQuery Mobile for a while and have become more and more familiar with jQuery Mobile. I have no reason to deny him. Here I will share with you how to use its configuration items.

See the code explanation:

$ (Document ). live ("pageinit", function (event) {$. mobile. loadingMessage = "loading data. Please wait ...... "; $. mobile. pageLoadErrorMessage = "sorry, the system seems to be taking a nap ...... "; $. mobile. loadingMessageTextVisible = true; $. mobile. loadingMessageTheme = "a"; $. mobile. pageLoadErrorMessageTheme = "a";/* $. extend ($. mobile, {activeBtnClass: "new-ui-btn-active", // default value of the activeBtnClass string: "ui-btn-active" assigns a class value for the excited button. ActivePageClass: "new-ui-page-active", // string default value: "ui-page-active", assign the class value ajaxEnabled: false to the current page, // Boolean default value: true indicates whether to disable the default Ajax link click and form submission, stop the hash listening, and then use the conventional HTTP method. AllowCrossDomainPages: false, // Boolean default value: false sets whether cross-origin is allowed. Because jQuery Mobile records location hash, // This may cause cross-site scripting (XSS) attacks to the website. Therefore, this option is set to false by default. AutoInitializePage: true, // Boolean default value: true. When the DOM is loaded, jQuery Mobile automatically calls the $. mobile. initializePage method. // If this attribute is set to false, the page is not initialized, that is, the page is blank. ButtonMarkup. hoverDelay: 200, // default integer value: 200 // This attribute sets the latency of adding hover and down classes after touching a jQuery Mobile button. // The smaller the value, the smaller the latency, and the more sensitive the touch, but it is likely that the page scroll is triggered incorrectly. Therefore, we recommend that the value not be too small. DefaultDialogTransition: "pop", // string default value: "pop" sets the default animation for the Ajax-based dialog box. DefaultPageTransition: "fade", // default value of the string: fade sets the default transition animation for pages that are redirected using Ajax. GradeA: true, // Boolean default value: "true" sets the return value of $. support. mediaquery. By default, true is returned only when the support conditions of all grade A mobile devices are met. HashListeningEnabled: true, // Boolean default value: true: Set whether to listen to and handle location. hash changes. IgnoreContentEnabled: false, // Boolean default value: false set this option to true, // and set the data-enhance = "false" attribute on the parent element of an element, this element will automatically reduce jQuery Mobile // enhancement (jQuery Mobile Element enhancement refers to jQuery Mobile's rich styles, interactions, and HTML structures for basic webpage elements. transformation ). LinkBindingEnabled: true, // default value of the Boolean value: true jQuery Mobile will automatically bind the anchor tag to the document. // setting this option to false will prevent all the anchor from being clicked, for example, cancel the activation button status. Generally, this attribute is set to false only when the anchor tag is handed over to another processing database. LoadingMessageTextVisible: false, // The default value of Boolean is false, which indicates whether prompt text is displayed when the page is loaded. LoadingMessage: "loading data. Please wait...", // string default value: "loading" to load the prompt text when the page displays the loading prompt. LoadingMessageTheme: "a", // string default value: "A" sets the default topic for loading the prompt when the loading prompt is displayed on the page. MinScrollBack: 250, // integer default value: 250 sets the minimum page rolling distance NS: "", // string default value: "" This attribute can change the namespace of jQurey Mobile, jQuery Mobile // arrange the namespace according to the data-NS attribute value. If the default value is null, data-role is used directly. For example, if the value of NS is set to "custom ", // if you need to define a jQuery Mobile header, you need to change it from the original data-role = "header" to data-custom-role = "header ", // other data-role must be changed to data-custom-role. In this way, developers can create their own namespaces to avoid conflicts with the original attributes of jQuery Mobile and facilitate custom themes. // Note that after you use the data-namespace, you need to update the selector of the jQuery Mobile css file. The format is as follows //. ui-mobile [data-custom-role = page],. ui-mobile [data-custom-role = dialog] ...... pageLoadErrorMessage: "Sorry, the system seems to be playing a nap ...... ", // string default value:" Error Loading Page "sets the prompt information displayed when an Error occurs during Ajax Loading. PageLoadErrorMessageTheme "e", // string default value: "e" sets the topic style of the error prompt box when Ajax fails to load the page. PushStateEnabled: true, // Boolean default value: true enable history in a supported browser. replaceState is an enhanced feature. // converts a hash-based Ajax request to a complete document path. JQuery Mobile recommends disabling this feature when disabling Ajax navigation and using a large number of external links. SubPageUrlKey: "ui-page", // string default value: "ui-page" URL parameter is used to point to child pages (such as nested list pages) generated by components ), // The URL is interpreted as example.html & ui-page = subpageIdentifier, the hash value before & ui-page = is sent to this URL by jQuery Mobile for Ajax requests. TouchOverflowEnabled: false // Boolean default value: false // sets whether to use the native region rolling feature of the device. Most devices except iOS5 do not currently support the native region rolling feature, therefore, we do not recommend modifying this attribute in jQuery Mobile 1.1.0 .}); * // $. Mobile. defaultPageTransition = "fade"; // $. mobile. defaultDialogTransition = "fade"; // default loading animation });
It is written here because of the time relationship.

Welcome to my blog !!! If you have any questions, please join the QQ group: 135430763 to learn together!


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.