[jQuery] 月曆套件
我相信很多人在編輯前端頁面的時候,一定會需要用到月曆的套件,今天我來介紹一下juery的月曆套件,過程還蠻簡單的

當然要先抓取jquery的js檔案嚕,作者適用jquery164的,另外還要抓另外抓取jQuery的元件

我是用  jquery-ui-1.8.18.custom.js 以及 jquery-ui-1.8.18.custom.css ,另外再抓取想用來顯示月曆的圖片或者其他就可

以了,以下是程式碼

 <script type="text/javascript">

$().ready(function(){

$( "#date" ).datepicker({
changeMonth: true,     //可以限定是否需要月份的下拉是選單,預設是沒有
changeYear: true,   //可以限定是否需要年份的下拉是選單,預設是沒有
dateFormat: 'yy/mm/dd',  //所顯示的default
showOn: "button",            
buttonImage: "./resources/images/icon/calendar.gif",
buttonImageOnly: true
});
});
 </script>

</head>
<body>
<input size="10"  type="text" id="date" readonly="readonly" />
</body>
</html>

以下是顯示畫面唷


按下去後





 
這就是月曆,還不錯用唷
參考網站 jquery官網  http://jqueryui.com/










arrow
arrow

    PG Levin Li 發表在 痞客邦 留言(0) 人氣()