I want to show tooltip using qtip plugin.
I show tooltip on cells of a table.
qtip content comes form a Div.
I am changin Div content on 'mouseenter' event of table cells.
but because of Div is empty on document ready all tooltips are empty.
How can I fix it? Should I change plugin property on mouseenter event ? or using callback functions...?
Here is my code :
$(function () {
//Refreshing Div content
$(".NegsoUser").bind("mouseenter", function (e) {
var UserName = $(this).text();
var fileName = '~/UI/Controls/SecurityManagement/Ajax/UserInormation.ascx';
var props = [{ 'Key': 'UserName', 'Value': UserName}];
var jsonText = JSON.stringify({ path: fileName, properties: props });
$("#NegsoUserMoreInfo").advloaduc({
ucMethodJsonParams: jsonText
});
});
$(".NegsoUser").qtip(
{
content: $("#NegsoUserMoreInfo").html()
});
});
qtip
has the updateContent
method, which you could use when you're updating the content of the div. I don't know what this advloaduc
plug-in is that you're using to update the div
, but it looks like it does an ajax call; so you'd want to call updateContent
in its success callback.