一個進行枚舉選擇的jquery外掛程式(仿easyui風格)

來源:互聯網
上載者:User

標籤:style   blog   http   ar   io   color   sp   java   on   

某次做項目要實現一個功能:

     按星期選擇一個連續的時間範圍 比如:周一到周五,周六到周日 或 周六到周三

聰明的朋友馬上想出辦法:用兩個選項為周一到周日的下拉式清單實現,對 那樣可以,但是我覺得不夠友好,

所以利用業餘時間寫下了這個jQuery小外掛程式。

   源碼:http://files.cnblogs.com/dint/easyui.daybox.rar

用法: 滑鼠點擊開始/結束項(紅色部分,可自訂)進行選擇和取消選擇

 :  周一到周五

     周六到周日

     周日到周三

 

 1 <html> 2 <head> 3 <title>daybox測試</title> 4 <script type=‘text/javascript‘ src=‘jquery.min.js‘></script>     5 <script type=‘text/javascript‘ src=‘easyui.daybox.js‘></script>     6 </head> 7 <body> 8 <div id=‘aDayboxDiv‘></div> 9 <script type=‘text/javascript‘>10 $(function(){11   $(‘#aDayboxDiv‘).daybox({12                     weeks: [{ text: ‘一‘, value: 2 }, { text: ‘二‘, value: 3 }, { text: ‘三‘, value: 4 },13                             { text: ‘四‘, value: 5 }, { text: ‘五‘, value: 6 }, { text: ‘六‘, value: 7 },14                             { text: ‘日‘, value: 1 }]15                     });16   $(‘#aDayboxDiv‘).daybox(‘setValue‘, 0, 2);17 });18 </script>19 </body>20 </html>

 運行結果:

一個進行枚舉選擇的jquery外掛程式(仿easyui風格)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.