index2.html 4.2 KB

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