悬停在工具提示上时工具提示闪烁

Kes*_*007 5 html javascript css jquery

将鼠标悬停在文本上时出现了一个提示。由于当我将光标移到工具提示上时工具提示很大,它开始闪烁或闪烁。我怎样才能阻止这种闪烁?

http://jsfiddle.net/keshav_1007/en5tcjaw/ - 这是小提琴

$(function() {
    /*tooltips*/
    $('.tooltip').hide();
    $('.trigger').mouseover(function() {
        var ttLeft,
            ttTop,
            $this=$(this),
            $tip = $('#ttip'),
            triggerPos = $this.offset(),
            triggerH = $this.outerHeight(),
            triggerW = $this.outerWidth(),
            tipW = $tip.outerWidth(),
            tipH = $tip.outerHeight(),
            screenW = $(window).width(),
            scrollTop = $(document).scrollTop();

        if (triggerPos.top - tipH - scrollTop > 0 ) {
            ttTop = triggerPos.top;
        } else {
            ttTop = triggerPos.top;            
        }

        var overFlowRight = (triggerPos.left + tipW) - screenW;    
        if (overFlowRight > 0) {
            ttLeft = triggerPos.left - overFlowRight - 10;    
        } else {
            ttLeft = triggerPos.left;    
        }


        $tip
           .css({
            left : ttLeft ,
            top : ttTop,
            position: 'absolute'
            })
            .stop(true,true).fadeIn(200);
    }); // end mouseover
    $('.trigger').mouseout(function () {
        $('.tooltip').stop(true,true).fadeOut(200);
    }); // end mouseout
    });
Run Code Online (Sandbox Code Playgroud)

我不希望更改工具提示的位置。我需要在工具提示上悬停时停止闪烁。如何做到这一点?

小智 24

将您的工具提示“pointer-events”CSS 属性设置为“none”。

.tooltip { 
    pointer-events: none;
}
Run Code Online (Sandbox Code Playgroud)