创新日历jQuery插件 详细日历

  • 源码大小:120.08KB
  • 所需积分:1积分
  • 源码编号:19JP-3204
  • 浏览次数:773次
  • 最后更新:2023年05月17日
  • 所属栏目:时间和时钟
本站默认解压密码:19jp.com 或 19jp_com

简介

Verbose Calendar是一个简单而实验性的jQuery日历插件,它提供了一年中所有日期的综合列表,按月份排序,便于浏览。

只需简单地点击向左或向右箭头,您就可以在年份之间切换,并保持时尚。它还支持日期点击事件,这可能有助于安排约会、标记重要事件或简单地跟踪时间。

如何使用它:

1.下载并包含jQuery详细日历插件的文件。

  1. <link rel="stylesheet" href="/path/to/calendar.css" />
  2. <script src="/path/to/cdn/jquery.min.js"></script>
  3. <script src="/path/to/jquery.calendar.min.js"></script>

2.调用函数日历在日历容器上,插件将完成其余工作。

  1. <div id="myCalendar">
  2. ...
  3. </div>
  1. $(document).ready(function() {
  2. $("#myCalendar").calendar({
  3. // ...
  4. });
  5. });

3.单击日期时执行回调函数。

  1. $(document).ready(function() {
  2. $("#myCalendar").calendar({
  3. click_callback: myCallback
  4. });
  5. });
  1. var myCallback = function(date) {
  2. // Returned date is a date object containing the day, month, and year.
  3. // date.day = day; date.month = month; date.year = year;
  4. alert("Open your Javascript console to see the returned result object.");
  5. console.log(date);
  6. }

4.可用于配置日历的选项。

  1. $("#myCalendar").calendar({
  2.  
  3. // internal settings
  4. d: d,
  5. year: d.getFullYear(),
  6. today: d.getDate(),
  7. month: d.getMonth(),
  8. current_year: d.getFullYear(),
  9.  
  10. // refers to Tipsy jQuery Plugin
  11. // https://www.jqueryscript.net/tooltip/Facebook-like-jQuery-Tootip-Plugin-tipsy.html
  12. tipsy_gravity: 's',
  13.  
  14. // scroll the page to the current date
  15. // refers to Scrollto jQuery plugin:
  16. // https://www.jqueryscript.net/animation/Smooth-Scroll-Plugin-jQuery-scrollTo.html
  17. scroll_to_date: true
  18.  
  19. });

预览截图