Demo

討論

保持飢餓,保持愚笨 (Stay hungry, stay foolish)。 史蒂夫·賈伯斯

公告

本網站已取消討論區的討論方式,如果您有問題請至LINE群行動條碼圖片網址,或Facebook社團

把後台用的日期選取功能搬到前台的來用

  • player
  • player 的個人頭像 Topic Author
  • Offline
  • 專家會員
  • 專家會員
More
2010-07-21 14:27 #18585 來自 player
player created the topic: 把後台用的日期選取功能搬到前台的來用
例如
<input id="date" name="date" size="10" type="text" /><img class="calendar" src="/templates/system/images/calendar.png" alt="calendar" id="date_img" />



<div class="art-article"><link rel="stylesheet" href="/media/system/css/calendar-jos.css" type="text/css" title="綠色" media="all" />
<script type="text/javascript" src="/media/system/js/calendar.js"></script>
<script type="text/javascript" src="/media/system/js/calendar-setup.js"></script>
<script type="text/javascript">
Calendar._DN = new Array ("週日", "週一", "週二", "週三", "週四", "週五", "週六", "週日");Calendar._SDN = new Array ("日", "一", "二", "三", "四", "五", "六", "日"); Calendar._FD = 0; Calendar._MN = new Array ("一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"); Calendar._SMN = new Array ("一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二");Calendar._TT = {};Calendar._TT["INFO"] = "關於月曆功能";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
"For latest version visit: http://www.dynarch.com/projects/calendar/ \n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Date selection:\n" +
"- Use the \xab, \xbb buttons to select year\n" +
"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
"- Hold mouse button on any of the above buttons for faster selection.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Time selection:\n" +
"- Click on any of the time parts to increase it\n" +
"- or Shift-click to decrease it\n" +
"- or click and drag for faster selection.";

Calendar._TT["PREV_YEAR"] = "點按即可跳到上一年份。點按並持續不放,即可出現年份選擇清單,以供選擇。";Calendar._TT["PREV_MONTH"] = "點按即可跳到上一個月。點按並持續不放,即可出現月份選擇清單,以供選擇。"; Calendar._TT["GO_TODAY"] = "直接跳到本日所在月份";Calendar._TT["NEXT_MONTH"] = "點按即可跳到下一個月。點按並持續不放,即可出現月份選擇清單,以供選擇。";Calendar._TT["NEXT_YEAR"] = "點按即可跳到下一年份。點按並持續不放,即可出現年份選擇清單,以供選擇。";Calendar._TT["SEL_DATE"] = "選擇日期.";Calendar._TT["DRAG_TO_MOVE"] = "以拖曳方式來移動位置";Calendar._TT["PART_TODAY"] = "(本日)";Calendar._TT["DAY_FIRST"] = "以 %s 當作第一天來顯示";Calendar._TT["WEEKEND"] = "0,6";Calendar._TT["CLOSE"] = "關閉";Calendar._TT["TODAY"] = "本日";Calendar._TT["TIME_PART"] = "(Shift-)點按或拖曳來改變內容值.";Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; Calendar._TT["TT_DATE_FORMAT"] = "%A, %B %e";Calendar._TT["WK"] = "wk";Calendar._TT["TIME"] = "時間:";

window.addEvent('domready', function() {Calendar.setup({
inputField : "date", // id of the input field
ifFormat : "%Y/%m/%d", // format of the input field
button : "date_img", // trigger for the calendar (button ID)
align : "Tl", // alignment (defaults to "Bl")
singleClick : true
});});


</script>

不過
Joomla 1.5.18裡的DHTML calendar 是舊版的

Please 登入 to join the conversation.