my.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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>11</title>
  9. <link rel="stylesheet" type="text/css" href="css/calendar.css" />
  10. <link rel="stylesheet" type="text/css" href="css/custom_2.css" />
  11. <script src="js/modernizr.custom.63321.js"></script>
  12. <style type="text/css">
  13. .custom-prev:before{
  14. width: 30px;
  15. height: 40px;
  16. cursor: pointer;
  17. margin: 0 1px;
  18. font-size: 20px;
  19. line-height: 40px;
  20. content: '\25c2';
  21. float:left;
  22. left: 5px;
  23. color: #1369d8;
  24. text-align: center;
  25. }
  26. .custom-next:before{
  27. width: 30px;
  28. height: 40px;
  29. cursor: pointer;
  30. margin: 0 1px;
  31. font-size: 20px;
  32. line-height: 40px;
  33. float:left;
  34. left: 5px;
  35. color: #1369d8;
  36. text-align: center;
  37. content: '\25b8';
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <div class="container">
  43. <div style="width: 250px;">
  44. <div class="custom-calendar-wrap">
  45. <div id="custom-inner" class="custom-inner">
  46. <div style="width: 250px;height: 40px;overflow: hidden;text-align: center;">
  47. <div style="width:170px;height: 40px;line-height:40px; font-size:20px; font-weight:bold; margin-left:auto;margin-right:auto; text-align: center;color: #1369d8;">
  48. <div id="custom-prev" class="custom-prev"></div>
  49. <div id="custom-year" style="float:left;"></div>
  50. <div id="custom-month"style="float:left;"></div>
  51. <div id="custom-next" class="custom-next"></div>
  52. </div>
  53. </div>
  54. <div id="calendar" class="fc-calendar-container"></div>
  55. </div>
  56. </div>
  57. </div>
  58. </div><!-- /container -->
  59. <script src="js/jquery.min.js"></script>
  60. <script type="text/javascript" src="js/jquery.calendario.js"></script>
  61. <script type="text/javascript" src="js/data.js"></script>
  62. <script type="text/javascript">
  63. $(function() {
  64. var transEndEventNames = {
  65. 'WebkitTransition' : 'webkitTransitionEnd',
  66. 'MozTransition' : 'transitionend',
  67. 'OTransition' : 'oTransitionEnd',
  68. 'msTransition' : 'MSTransitionEnd',
  69. 'transition' : 'transitionend'
  70. },
  71. transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ],
  72. $wrapper = $( '#custom-inner' ),
  73. $calendar = $( '#calendar' ),
  74. cal = $calendar.calendario( {
  75. onDayClick : function( $el, $contentEl, dateProperties ) {
  76. if( $contentEl.length > 0 ) {
  77. showEvents( $contentEl, dateProperties );
  78. }
  79. },
  80. caldata : codropsEvents,
  81. displayWeekAbbr : true
  82. } ),
  83. $day = $( '#custom-day' ).html( cal.getDay()),
  84. $week = $( '#custom-week' ).html( cal.getWeek()),
  85. $month = $( '#custom-month' ).html( cal.getMonthName() + "月"),
  86. $year = $( '#custom-year' ).html( cal.getYear() + "年");
  87. $( '#custom-next' ).on( 'click', function() {
  88. cal.gotoNextMonth( updateMonthYear );
  89. } );
  90. $( '#custom-prev' ).on( 'click', function() {
  91. cal.gotoPreviousMonth( updateMonthYear );
  92. } );
  93. function updateMonthYear() {
  94. $month.html( cal.getMonthName() + "月");
  95. $year.html( cal.getYear() + "年");
  96. }
  97. // just an example..
  98. function showEvents( $contentEl, dateProperties ) {
  99. alert(11);
  100. }
  101. });
  102. </script>
  103. </body>
  104. </html>