移動端日期及選擇外掛程式mobiscroll

來源:互聯網
上載者:User

標籤:皮膚   code   href   http   border   ado   use   oda   script   

  在很多的form表單中,我們經常會用到日期外掛程式,這類外掛程式比較多,這裡推薦一個很好用的移動端日期外掛程式:mobiscroll

  首先引入外掛程式相關檔案

  

<link href="css/mobiscroll.css" rel="stylesheet" /><link href="css/mobiscroll_date.css" rel="stylesheet" /><script src="js/jquery.min.js"></script> <script src="js/mobiscroll_date.js"></script> <script src="js/mobiscroll.js"></script> 

  找到需要插入的日期元素div

  

<input style="display:inline-block;width: 72%;height: 0.6rem;border:1px solid #ccc;text-align: left;font-size:0.24rem;" name="page1_time" type="text" name="USER_AGE" id="USER_AGE" readonly class="input" />

  初始化

  

$(document).ready(function() {    var currYear = (new Date()).getFullYear();        var opt={};    opt.date = {preset : ‘date‘};    opt.datetime = {preset : ‘datetime‘};    opt.time = {preset : ‘time‘};    opt.default = {        theme: ‘android-ics light‘, //皮膚樣式        display: ‘modal‘, //顯示方式         mode: ‘scroller‘, //日期選擇模式        dateFormat: ‘yyyy-mm-dd‘,        lang: ‘zh‘,        showNow: true,        nowText: "今天",        startYear: currYear - 50, //開始年份        endYear: currYear + 10 //結束年份    };        $("#USER_AGE").mobiscroll($.extend(opt[‘date‘],opt[‘default‘]));});

  如下:

  

  外掛程式還有select選擇的功能,可以查看jq外掛程式官網

移動端日期及選擇外掛程式mobiscroll

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.