Try to trigger the mouseover()
event after initializing the tooltip:
$('.links').tooltip().mouseover();
Question
I want to programmatically open a jquery ui tooltip (not hover) with a custom content tooltip like this here. Is there any way to do this ?
$('.links').tooltip({
content: function() {
var $this = $(this);
var extra = $this.text();
var lowertext = "<div class ='tooltiptext'>Find out more about " + extra + "</div>"
return lowertext;
}
$('.links').tooltip("open");
La solution
Try to trigger the mouseover()
event after initializing the tooltip:
$('.links').tooltip().mouseover();
Autres conseils
Yes it works like you tried it, but your problem are your typos, you forgot some ;
and brackets also. try like this:
$('.links').tooltip( {
content: function () {
var lowertext = "<div class='tooltiptext'>Find out more about " + $(this).text() + "</div>";
return lowertext;
}
});
$('.links').tooltip('open');