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?
Sometimes tooltips overlap with the element they are attached to. This causes flickering when moving the mouse-cursor.
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.
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" .
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.
Set your tooltip "pointer-events" CSS property to "none".
.tooltip {
pointer-events: none;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With