문제

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");
도움이 되었습니까?

해결책

Try to trigger the mouseover() event after initializing the tooltip:

$('.links').tooltip().mouseover();

다른 팁

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');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top