Extended Ajax calendar for tool tips
-
Hi all,
just wanted to share this. I’ve just extended the Ajax calendar to allow tool tips. Here’s how to do it.
- Download your JQuery tool tip class of choice, I used this one: https://flowplayer.org/tools/tooltip/index.html
- Put this in the includes/js folder of the plugin
- open the events-manager.php file and find the commented line: Enqueing public scripts and styles
- add the following line of code:
wp_enqueue_script('jquery-tips', WP_PLUGIN_URL.'/events-manager/includes/js/jquery-tips.js'); //jQuery tools
I renamed my tool tips file to jquery-tips.js, but you can call it anything you like - open up the events-manager.js file and right at the top in the /* Calendar AJAX */ section paste the following line:
$(".e-tip[title]").tooltip()
then in the load event for the calendar paste this again (needs to be instantiated again when the next page of the calendar loads). So my final ajax code looks like this:`$(“.e-tip[title]”).tooltip(
{
position:”bottom center”,
effect:”fade”
});
$(‘.em-calendar-wrapper a’).unbind(“click”);
$(‘.em-calendar-wrapper a’).die(“click”);
$(‘a.em-calnav, a.em-calnav’).live(‘click’, function(e){
e.preventDefault();
$(this).closest(‘.em-calendar-wrapper’).prepend(‘<div class=”loading” id=”em-loading”></div>’);
var url = em_ajaxify($(this).attr(‘href’));
$(this).closest(‘.em-calendar-wrapper’).load(url, function()
{
$(this).trigger(’em_calendar_load’);
$(“.e-tip[title]”).tooltip(
{
position:”bottom center”,
effect:”fade”
});
});
} );`
Voila!
- The topic ‘Extended Ajax calendar for tool tips’ is closed to new replies.