Saturday, November 23, 2013

Enable poshy tooltip in append html

Poshytool tip in append html

If we are appending some html elements to existing html, the poshy tool tip will not work.

Here is the code to overcome such issue


$(document).ready(function() {

$( document ).on( "mouseout", ".fc-event",
function() {
var reqUrl = $(this).attr('href');
showThemeKeyowrds(this,reqUrl)
});

$( document ).on( "mouseleave", ".fc-event" ,
function() {
$("div [class^='quickcont_popup']").poshytip('hide');
}) ;

});
var ajaxtooltip = {};
function showThemeKeyowrds(ele,reqUrl)
{
$("div [class^='fc-event']").poshytip('hide');
$(ele).poshytip({
liveEvents: true,
content: function(updateCallback) {

var rel = reqUrl;

if (ajaxtooltip[rel] && ajaxtooltip[rel].container)
return ajaxtooltip[rel].container;
if (!ajaxtooltip[rel]) {
ajaxtooltip[rel] = { container: null };

var params = "?url"+rel;
var url = MAIN_URL+"smb/calendar/eventtooltip"+params ;
$.get(url,
function(data) {
var container = $('<div/>').html(data);

// call the updateCallback function to update the content in the main tooltip
// and also store the content in the cache
updateCallback(ajaxtooltip[rel].container = container);
}
);
}
return 'Loading...';
},
className: 'tip-darkgray',
bgImageFrameSize: 11,
alignY: 'bottom',
});
$(ele).poshytip('show');
}

No comments:

Post a Comment