Hello to all, welcome to therichpost.com. In this post, I will tell you, How to add class to event title in fullcalendar? fullcalendar is the best A JavaScript event calendar. Customizable and open source.
Here is the complete working and tested to add class to event title in fullcalendar and you can add this into your html file:
<!DOCTYPE html> <html> <head> <meta charset='utf-8' /> <link href='https://fullcalendar.io/releases/fullcalendar/3.9.0/fullcalendar.min.css' rel='stylesheet' /> <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/ bootstrap.min.css'> <link href='https://fullcalendar.io/releases/fullcalendar/3.9.0/fullcalendar.print.min.css' rel='stylesheet' media='print' /> <script src='https://fullcalendar.io/releases/fullcalendar/3.9.0/lib/moment.min.js'></script> <script src='https://fullcalendar.io/releases/fullcalendar/3.9.0/lib/jquery.min.js'></script> <script src='https://fullcalendar.io/releases/fullcalendar/3.9.0/fullcalendar.min.js'></script> <script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min .js'></script> <script> $(document).ready(function() { $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,basicWeek,basicDay' }, defaultDate: '2018-03-12', navLinks: true, // can click day/week names to navigate views editable: true, eventLimit: true, // allow "more" link when too many events events: [ { title: 'All Day Event', start: '2018-03-01', }, { title: 'Long Event', start: '2018-03-07' }, { id: 999, title: 'Repeating Event', start: '2018-03-09' }, { id: 999, title: 'Repeating Event', start: '2018-03-16' }, { title: 'Conference', start: '2018-03-11' }, { title: 'Meeting', start: '2018-03-12' }, { title: 'Lunch', start: '2018-03-12' }, { title: 'Meeting', start: '2018-03-12' }, { title: 'Happy Hour', start: '2018-03-12' }, { title: 'Dinner', start: '2018-03-12' }, { title: 'Birthday Party', start: '2018-03-13' }, { title: 'Click for Google', url: 'http://google.com/', start: '2018-03-28' } ], eventRender: function(event, element, view) { element.find('span.fc-title').addClass('yourClass'); } }); }); </script> <style> body { margin: 40px 10px; padding: 0; font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif; font-size: 14px; } #calendar { max-width: 900px; margin: 0 auto; } .hoverEffect { font-size: 29px; position: absolute; margin: 30px 55px; cursor: pointer; } </style> </head> <body> <div id='calendar'></div> </body> </html>
If you have any query related to this post then please do comment below and i will do most posts for fullcalendar.
Thank you