jquery ui tooltip manual open /close

后端 未结 5 504
囚心锁ツ
囚心锁ツ 2020-12-24 07:48

is there a way to manually open close the jquery ui tooltip? I just want it to react to a click event toggling on/off. You can unbind all mouse events and it will rebind t

5条回答
  •  一个人的身影
    2020-12-24 08:27

    If you want to just unbind the events and woudn't like to make your own custom tooltip.

    $("#some-id").tooltip(tooltip_settings)
                 .on('mouseout focusout', function(event) {
                      event.stopImmediatePropagation();
                 });
    
    $("#some-id").attr("title", "Message");
    $("#some-id").tooltip("open");
    

    mouseout blocks the tooltop disappearing by moving the mouse cursor

    focusout blocks the tooltop disappearing by keyboard navigation

提交回复
热议问题