Jquery UI tooltip. Set timeout and set hover events. Freeze tooltip on mouseover

前端 未结 7 1270
遥遥无期
遥遥无期 2020-12-09 11:51

I\'ve googled about 2 days and can\'t figure out how to set timeout for http://api.jqueryui.com/tooltip/ ???

Maybe i should use jquery hoverIntent ?

here is

相关标签:
7条回答
  • 2020-12-09 12:42

    I also looked for a similar solution, showing the tooltip normally, but when mouseover on the tooltip it should stay (the content of a tooltip is some buttons).

    I don't want a whole framework(qtip) to do just that, i'm already using jqUI all over my site.

    so i did this:

    $( document ).tooltip({
      show: null, // show immediately 
      items: '.btn-box-share',
      hide: {
        effect: "", // fadeOut
      },
      open: function( event, ui ) {
        ui.tooltip.animate({ top: ui.tooltip.position().top + 10 }, "fast" );
      },
      close: function( event, ui ) {
        ui.tooltip.hover(
            function () {
                $(this).stop(true).fadeTo(400, 1); 
                //.fadeIn("slow"); // doesn't work because of stop()
            },
            function () {
                $(this).fadeOut("400", function(){ $(this).remove(); })
            }
        );
      }
    });
    
    0 讨论(0)
提交回复
热议问题