JQuery Mobile Development Date plugin Mobiscroll use instructions _jquery

Source: Internet
Author: User

Recently in the mobile development, using jquery Mobile, mobile plug-ins than the Web plug-ins more than the choice of less, some need to package their own, but the skill is not enough ah.

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

Jquerymobiledatebox This on board bad performance, a little bit of card

Mobiscroll performance is better than the former, the effect is more concise, more smooth stroke

In contrast

Ladies and gentlemen, which one do you think looks reader?

Anyway, I think the mobiscroll effect is better, okay, look at some of this guy's use.

The first step: to the official website to download a compressed package, download need to register before downloading. When downloading, you can choose the frame and skin style you use and so on, look at the picture below

This assumes that you have successfully registered and downloaded

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

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

We can do this. Initialize the date control:

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

Preview it, is it possible to use it! Only this interface is in English, for the people are a bit uncomfortable, and the official website did not provide Chinese language pack, but no relationship, the official website API is good, we can set some common properties to make it conform to the normal date format.

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

Okay, so just look at the effect chart.

That's a clear look. Do not write, just write so much, the official website of Docs wrote very detailed, this is not listed here, interested friends can go to research.

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.