123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <!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/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>Flexible Calendar <span>with jQuery and CSS3</span></h1>
- <nav class="codrops-demos">
- <a href="index.html">Demo 1</a>
- <a class="current-demo" href="index2.html">Demo 2</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="js/jquery.min.js"></script>
- <script type="text/javascript" src="js/jquery.calendario.js"></script>
- <script type="text/javascript" src="js/data.js"></script>
- <script type="text/javascript">
- $(function() {
-
- var transEndEventNames = {
- 'WebkitTransition' : 'webkitTransitionEnd',
- 'MozTransition' : 'transitionend',
- 'OTransition' : 'oTransitionEnd',
- 'msTransition' : 'MSTransitionEnd',
- 'transition' : 'transitionend'
- },
- transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ],
- $wrapper = $( '#custom-inner' ),
- $calendar = $( '#calendar' ),
- cal = $calendar.calendario( {
- onDayClick : function( $el, $contentEl, dateProperties ) {
- if( $contentEl.length > 0 ) {
- showEvents( $contentEl, dateProperties );
- }
- },
- caldata : codropsEvents,
- displayWeekAbbr : true
- } ),
- $month = $( '#custom-month' ).html( cal.getMonthName() ),
- $year = $( '#custom-year' ).html( cal.getYear() );
- $( '#custom-next' ).on( 'click', function() {
- cal.gotoNextMonth( updateMonthYear );
- } );
- $( '#custom-prev' ).on( 'click', function() {
- cal.gotoPreviousMonth( updateMonthYear );
- } );
- function updateMonthYear() {
- $month.html( cal.getMonthName() );
- $year.html( cal.getYear() );
- }
- // just an example..
- function showEvents( $contentEl, dateProperties ) {
- hideEvents();
-
- var $events = $( '<div id="custom-content-reveal" class="custom-content-reveal"><h4>Events for ' + dateProperties.monthname + ' ' + dateProperties.day + ', ' + dateProperties.year + '</h4></div>' ),
- $close = $( '<span class="custom-content-close"></span>' ).on( 'click', hideEvents );
- $events.append( $contentEl.html() , $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();
- }
- }
-
- });
- </script>
- </body>
- </html>
|