Only close tooltip if mouse is not over target or tooltip

前端 未结 4 1202
刺人心
刺人心 2020-12-05 04:47

Using the jQuery UI tooltip, I would like to keep the tooltip open if I\'m over the target, or if I\'m over the tooltip itself.

I\'m thinking I can use the close cal

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 05:21

    This is a simple solution for div elements:

    $(function() {
        $("#mydiv").tooltip({
            effect: 'slide',
            content: 'loading...',
            open: function (event, ui) {
                $(ui.tooltip).appendTo(this);
            }
        });
    });
    

    http://jsfiddle.net/4YDGp/10/

提交回复
热议问题