Mobiscroll usage notes for the date plugin in JQuery mobile development

Source: Internet
Author: User

Recently in the development of mobile, using jquery Mobile, mobile plug-in is not as much as the web side of the plug-in, choose less, some need to package themselves, but the skill is not enough ah.

Date plug-in JQM also provides built-in, but the style is not good-looking, had to Baidu, Google, found two models Jquery-mobile-datebox and mobiscroll-2.3

Jquerymobiledatebox This on the board performance is not good, the performance of a bit card

Mobiscroll performance is better than the former, the effect is more concise, smoother strokes

Put it together in comparison

Hey, crossing, what do you think looks good?

Anyway, I think the mobiscroll effect is better, well, let's see how this guy works.

The first step: to the official website to download a compressed package, the download needs to register before you can download. When downloading, you can choose the frame and skin style you use to see

This assumes that you have successfully registered and downloaded the

The second step, create a new HTML5 file, jquery.js,jquerymobile.js and so on necessary files, write the following code into your file:

<div data-role= "Fieldcontain" >         <label for= "Txtbirthday" > Date of birth:</label> <input type=         " Text "data-role=" Datebox "   id=" Txtbirthday "name=" Birthday "/> </div>

We can initialize the date control like this:

$ (' Input:jqmdata (role= "Datebox") '). Mobiscroll (). Date ();

Preview it, is not ready to use it! But this interface is English, for the Chinese people are a bit uncomfortable, and the official website does not provide a language package, but no relationship, the official website of the API is good, we can set some common properties to conform to the regular date format.

Initialize date control    var opt = {        preset: ' Date ',//Date        theme: ' JQM ',//Skin style        display: ' Modal ',//display mode         mode: ' Clickpick ',//date selection mode        dateformat: ' Yy-mm-dd ',//date format        setText: ' OK ',//Confirm button name        canceltext: ' Cancel ',//Cancel button name me        dateorder: ' YYMMDD ',//panel date arrangement format        daytext: ' Day ', Monthtext: ' Month ', Yeartext: ' Year ',//panel of the month and day text        endyear:2020// End year    };        $ (' Input:jqmdata (role= "Datebox") '). Mobiscroll (opt);
Okay, let's see.

This is a clear view. Do not write, this is written so much, the official website of the docs written very detailed, not listed here, interested friends can go to study, in the process of research what experience do not post Oh!

Mobiscroll usage notes for the date plugin in JQuery mobile development

Related Article

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.