Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltip flickers while hovering on the tooltip

I have a tootlip appearing while hovering on a text. Since the tooltip is big when i am moving the cursor over the tooltip it starts flickering or blinking. How can i stop that flickering?

http://jsfiddle.net/keshav_1007/en5tcjaw/ - here is the fiddle

$(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
    });

I dont want the position of the tooltip to be changed. I need to stop the flickering while hovering on the tooltip. How to achieve that?

like image 231
Keshav1007 Avatar asked Nov 24 '15 09:11

Keshav1007


People also ask

Why is my tooltip flickering?

Sometimes tooltips overlap with the element they are attached to. This causes flickering when moving the mouse-cursor.

What is tooltip on hover?

Tooltip is a concept used in HTML for showing some extra information about the specifically selected element. This can be done on the mouse hover effect whenever the user moves the mouse over an element that is using a tooltip to display specified information about that element.

How do I make my tooltip always visible?

Enabling sticky tooltip To make an element display its tooltip permanently, we use its showTooltipOn property. To make tooltip always be shown, set it to "always" .

What is tooltip bootstrap?

The Tooltip plugin is small pop-up box that appears when the user moves the mouse pointer over an element: Hover over me Hover over me. Tip: Plugins can be included individually (using Bootstrap's individual "tooltip. js" file), or all at once (using "bootstrap.


1 Answers

Set your tooltip "pointer-events" CSS property to "none".

.tooltip { 
    pointer-events: none;
}
like image 146
CorvusCorax Avatar answered Nov 01 '22 12:11

CorvusCorax