Advertisement
parthvhirapara

FullCalender : Tooltip for fullcalendar

Aug 22nd, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Tooltip for fullcalendar in year view
  2. eventMouseover: function(calEvent,jsEvent) {
  3.             xOffset = 10;
  4.             yOffset = 30;
  5.             $("body").append(calEvent.tooltip);
  6.             $("#tooltip")
  7.                 .css("top",(jsEvent.clientY - xOffset) + "px")
  8.                 .css("left",(jsEvent.clientX + yOffset) + "px")
  9.                 .fadeIn("fast");
  10.     },
  11.     eventMouseout: function(calEvent,jsEvent) {
  12.         $("#tooltip").remove();
  13.     }
  14.    
  15. $('#calendar').fullCalendar({
  16.     events: [
  17.         {
  18.             title: 'My Event',
  19.             start: '2010-01-01',
  20.             description: 'This is a cool event'
  21.         }
  22.         // more events here
  23.     ],
  24.     eventRender: function(event, element) {
  25.         element.qtip({
  26.             content: event.description
  27.         });
  28.     }
  29. });
  30.  
  31.  
  32. //===============================================================================
  33.  
  34.  
  35. $(document).ready(function() {
  36. var d = new Date();
  37. var y = d.getFullYear();
  38. var m = d.getMonth();
  39. $('#calendar').fullCalendar({
  40. draggable: false,
  41. showTime: false,
  42. events: [
  43.  
  44. {
  45. id: 1,
  46. title: "New Event",
  47. start: "2009-08-14 00:00:00",
  48. end: "2009-08-17 00:00:00",
  49. tooltip: "<p id='tooltip'><strong>New Event Addition</strong><br/>Here&#039;s my event description.<br/><br/>Aug 14, 2009 - Aug 17, 2009</p>"
  50. },
  51. {
  52. id: 2,
  53. title: "Another Event",
  54. start: "2009-08-20 13:00:00",
  55. end: "2009-08-20 16:00:00",
  56. tooltip: "<p id='tooltip'><strong>Another Event Addition</strong><br/>Here&#039;s my event description.<br/><br/>Aug 20, 2009<br/>1:00 pm - 4:00 pm</p>"
  57. }
  58. ],
  59. eventMouseover: function(calEvent,jsEvent) {
  60. xOffset = 10;
  61. yOffset = 30;
  62. $("body").append(calEvent.tooltip);
  63. $("#tooltip")
  64. .css("top",(jsEvent.clientY - xOffset) + "px")
  65. .css("left",(jsEvent.clientX + yOffset) + "px")
  66. .fadeIn("fast");
  67. },
  68. eventMouseout: function(calEvent,jsEvent) {
  69. $("#tooltip").remove();
  70. }
  71. });
  72. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement