forked from calendariofx/calendario
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.html
122 lines (115 loc) · 5.76 KB
/
index2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<!--[if IE 9]><html class="no-js ie9"><![endif]-->
<!--[if gt IE 9]><!--><html class="no-js"><!--<![endif]-->
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flexible Calendar</title>
<meta name="description" content="Flexible Calendar with jQuery and CSS3" />
<meta name="keywords" content="responsive, calendar, jquery, plugin, full page, flexible, javascript, css3, media queries" />
<meta name="author" content="Codrops" />
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/calendar.css" />
<link rel="stylesheet" type="text/css" href="css/custom_2.css" />
<script src="js/modernizr.custom.63321.js"></script>
</head>
<body>
<div class="container">
<!-- Codrops top bar -->
<div class="codrops-top clearfix">
<a href="http://tympanus.net/Development/Stapel/"><strong>« Previous Demo: </strong>Adaptive Thumbnail Pile Effect</a>
<span class="right">
<a href="http://tympanus.net/codrops/?p=12416"><strong>Back to the Codrops Article</strong></a>
</span>
</div><!--/ Codrops top bar -->
<header class="clearfix">
<h1>Calendario <span>It just got more flexible</span></h1>
<nav class="codrops-demos">
<a href="index.html">Demo 1</a>
<a class="current-demo" href="index2.html">Demo 2</a>
<a href="index3.html">Demo 3</a>
</nav>
</header>
<section class="main">
<div class="custom-calendar-wrap">
<div id="custom-inner" class="custom-inner">
<div class="custom-header clearfix">
<nav>
<span id="custom-prev" class="custom-prev"></span>
<span id="custom-next" class="custom-next"></span>
</nav>
<h2 id="custom-month" class="custom-month"></h2>
<h3 id="custom-year" class="custom-year"></h3>
</div>
<div id="calendar" class="fc-calendar-container"></div>
</div>
</div>
</section>
</div><!-- /container -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript" src="js/calendario.js"></script>
<script type="text/javascript" src="js/data.js"></script>
<script type="text/javascript">
$(function() {
function updateMonthYear() {
$( '#custom-month' ).html( $( '#calendar' ).calendario('getMonthName') );
$( '#custom-year' ).html( $( '#calendar' ).calendario('getYear'));
}
$(document).on('finish.calendar.calendario', function(e){
$( '#custom-month' ).html( $( '#calendar' ).calendario('getMonthName') );
$( '#custom-year' ).html( $( '#calendar' ).calendario('getYear'));
$( '#custom-next' ).on( 'click', function() {
$( '#calendar' ).calendario('gotoNextMonth', updateMonthYear);
} );
$( '#custom-prev' ).on( 'click', function() {
$( '#calendar' ).calendario('gotoPreviousMonth', updateMonthYear);
} );
$( '#custom-current' ).on( 'click', function() {
$( '#calendar' ).calendario('gotoNow', updateMonthYear);
} );
});
$('#calendar').on('shown.calendar.calendario', function(){
$('div.fc-row > div').on('onDayClick.calendario', function(e, dateprop) {
console.log(dateprop);
if(dateprop.data) {
showEvents(dateprop.data.html, dateprop);
}
});
});
var transEndEventNames = {
'WebkitTransition' : 'webkitTransitionEnd',
'MozTransition' : 'transitionend',
'OTransition' : 'oTransitionEnd',
'msTransition' : 'MSTransitionEnd',
'transition' : 'transitionend'
},
transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ],
$wrapper = $( '#custom-inner' );
function showEvents( contentEl, dateprop ) {
hideEvents();
var $events = $( '<div id="custom-content-reveal" class="custom-content-reveal"><h4>Events for ' + dateprop.monthname + ' '
+ dateprop.day + ', ' + dateprop.year + '</h4></div>' ),
$close = $( '<span class="custom-content-close"></span>' ).on( 'click', hideEvents);
$events.append( contentEl.join('') , $close ).insertAfter( $wrapper );
setTimeout( function() {
$events.css( 'top', '0%' );
}, 25);
}
function hideEvents() {
var $events = $( '#custom-content-reveal' );
if( $events.length > 0 ) {
$events.css( 'top', '100%' );
Modernizr.csstransitions ? $events.on( transEndEventName, function() { $( this ).remove(); } ) : $events.remove();
}
}
$( '#calendar' ).calendario({
caldata : events,
displayWeekAbbr : true,
events: ['click', 'focus']
});
});
</script>
</body>
</html>