Try this.
$('.tool').tooltip({
content: function() {
var element = $( this );
return 'content';
//return element.attr( "title" ); //or like this
}
});
문제
I have between 1 and 10 tags in my code which require a jquery ui tooltip to be added.
the a tags all have a class of tool
the a tags all have a title attribute which contains what I want to appear in the tooltip.
My question is how do I iterate over the a tags
ie
$( ".tool" ).tooltip({ content: });
Struggling to get my head around this one - can anyone help me with the logic / code required? Because there can be more than one, I am slightly confused.
What might make it slightly more confusing, is that the tags are all entered into the page via ajax .load
Thanks in anticipation for any help which can be given.
해결책
Try this.
$('.tool').tooltip({
content: function() {
var element = $( this );
return 'content';
//return element.attr( "title" ); //or like this
}
});