Kalendae.js日歷控件可多選日期時間代碼



229 913 305



特效描述:Kalendae.js日歷控件 可多選日期時間,Kalendae.js日歷時間多選代碼,日期時間,日歷控件

代碼結構

1. 引入CSS

<link rel="stylesheet" href="build/kalendae.css" type="text/css" charset="utf-8">

2. 引入JS

<script src="src/moment.js" type="text/javascript" charset="utf-8"></script>
<script src="build/kalendae.js" type="text/javascript" charset="utf-8"></script>
<script src="build/kalendae.standalone.js" type="text/javascript" charset="utf-8"></script>
<script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
<script src="/follow.js" type="text/javascript"></script>

3. HTML代碼

	<div style="text-align:center;clear:both;">
<script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
<script src="/follow.js" type="text/javascript"></script>
</div>
	<p>Single Select</p>
	<script type="text/javascript" charset="utf-8">
		new Kalendae(document.body, {
			months:1,
			mode:'single',
			selected:Kalendae.moment().subtract({M:1})
		});
		new Kalendae({
			attachTo:document.body,
			months:2,
			mode:'single',
			selected:Kalendae.moment().subtract({M:1})
		});
		new Kalendae({
			attachTo:document.body,
			months:3,
			mode:'single',
			selected:Kalendae.moment().subtract({M:1})
		});
	</script>
	<p>Range Select</p>
	<script type="text/javascript" charset="utf-8">
		new Kalendae(document.body, {
			months:1,
			mode:'range',
			selected:[Kalendae.moment().subtract({M:1}), Kalendae.moment().add({M:1})]
		});
		new Kalendae({
			attachTo:document.body,
			months:2,
			mode:'range',
			selected:[Kalendae.moment().subtract({M:1}), Kalendae.moment().add({M:1})]
		});
		new Kalendae({
			attachTo:document.body,
			months:3,
			mode:'range',
			selected:[Kalendae.moment().subtract({M:1}), Kalendae.moment().add({M:1})]
		});
	</script>
	<p>Multi-Select</p>
	<script type="text/javascript" charset="utf-8">
		new Kalendae(document.body, {
			months:1,
			mode:'multiple',
			selected:[Kalendae.moment().subtract({M:1}), Kalendae.moment().add({M:1})]
		});
		new Kalendae({
			attachTo:document.body,
			months:2,
			mode:'multiple',
			selected:[Kalendae.moment().subtract({M:1}), Kalendae.moment().add({M:1})]
		});
		new Kalendae({
			attachTo:document.body,
			months:3,
			mode:'multiple',
			selected:[Kalendae.moment().subtract({M:1}), Kalendae.moment().add({M:1})]
		});
	</script>
	<p>Week Select</p>
	<script type="text/javascript" charset="utf-8">
		new Kalendae(document.body, {
			months:1,
			mode:'week',
			selected:Kalendae.moment().subtract({M:1})
		});
		new Kalendae({
			attachTo:document.body,
			months:2,
			mode:'week',
			selected:Kalendae.moment().subtract({M:1})
		});
		new Kalendae({
			attachTo:document.body,
			months:3,
			mode:'week',
			selected:Kalendae.moment().subtract({M:1})
		});
	</script>
	<hr>
	<p>Blackout and Direction Tests</p>
	<script type="text/javascript" charset="utf-8">
		//direction
		new Kalendae(document.body, {
			months:3,
			direction:'future'
		});
		//direction
		new Kalendae(document.body, {
			months:3,
			direction:'past'
		});
		//blackout
		new Kalendae(document.body, {
			blackout: function (date) {
				return Kalendae.moment(date).date() % 2; //blackout every other day
			}
		});
		//blackout AND direction
		new Kalendae(document.body, {
			direction:'future',
			blackout: function (date) {
				return [1,0,0,0,0,0,1][Kalendae.moment(date).day()]; //blackout weekends
			}
		});
	</script>
	<hr>
	<p>Class Map Test</p>
	<script type="text/javascript" charset="utf-8">
		//direction
		var classMap = [];
			classMap[ Kalendae.moment().add({d:5}).format('YYYY-MM-DD') ] = 'closed';
		new Kalendae(document.body, {
			dateClassMap: classMap
		});
	</script>
	<hr>
	Click this input element: <input type="text" value="2/16/2012" id="input1">
	<script type="text/javascript" charset="utf-8">
		var k4 = new Kalendae.Input('input1', {
			months:2
		});
	</script>
	<hr>
	This calendar is auto-created.
	<div class="auto-kal"></div>
	<hr>
	So is the one on this input.
	<input type="text" class="auto-kal">
	<hr>
	This calendar is auto-created with months: 3 and direction: 'future'.
	<div class="auto-kal" data-kal="months: 3, direction: 'future'"></div>
	<hr>
	This calander on this input is auto-created with direction: 'future'.
	<input type="text" class="auto-kal" data-kal="direction: 'future'">
	<hr>
	This calendar allows clicks outside of the focused month (dayOutOfMonthClickable: true):
	<div class="auto-kal" data-kal="months: 1, dayOutOfMonthClickable: true"></div>
	<hr>
	This calendar has no year navigation (useYearNav: false).
	<div class="auto-kal" data-kal="useYearNav: false">



用戶評論
大牛,別默默的看了,快登錄幫我點評一下吧!:)      登錄 | 注冊


熱門標簽: 滾動切換 滾動條切換 滑動選項卡 滑動切換 選項卡切換 選項卡 切換 tab切換 頁面切換 選項卡插件 切換插件 滑動手風琴 切換按鈕 日期時間 時鐘 日歷 時間 日歷插件 時間日期插件 表單 表單美化 表單插件 表單美化插件 日歷選擇器 時間選擇器 時間日期插件 時間日期 文字切換 文字選項卡 列表切換 翻頁切換 按鈕控制
?
×
×

注冊

官方QQ群

掃描上面二維碼加微信群

官方QQ群

jQuery/js討論群
群號:642649996
Css3+Html5討論群
群號:322131262

加群請備注:從官網了解到

老夫子电子