简体   繁体   English

工具提示悬停闪烁

[英]Tooltip hover flickering

I'm trying to add tooltips (via Bootstrap) such that when you hover over an image, it shows the tooltip after a 500ms delay. 我正在尝试添加工具提示(通过Bootstrap),以便当您将鼠标悬停在图像上时,它会在500ms延迟后显示工具提示。 The image has a regular state and a hover state: 图像具有常规状态和悬停状态:

CSS: CSS:

.image {
  background-image: url('../img/test.png');
  background-repeat: no-repeat;
  opacity: 0.3;
  filter: alpha(opacity=30);
}

.image:hover {
  opacity: 1;
  filter: alpha(opacity=100);
}

HTML: HTML:

<div class="image"></div>

JavaScript: JavaScript的:

$('.image').tooltip({title: 'Text', delay: { show: 500, hide: 0 }, trigger: 'hover', html: true});

The problem is that when I hover over the image to check the tooltip, the image flashes without ever showing the tooltip, as such: 问题是,当我将鼠标悬停在图像上以检查工具提示时,图像会闪烁,而不会显示工具提示,例如:

http://i.imgur.com/S6YvXFT.gif

Seems to work just fine. 似乎工作正常。 Are you not including jQuery, or perhaps since you forgot to assign a height and width it's popping up somewhere you don't expect? 您是否不包括jQuery,或者可能是因为您忘记分配高度和宽度,所以它突然出现在您不希望看到的地方?

jsfiddle : http://jsfiddle.net/8S7kP/1/ jsfiddlehttp : //jsfiddle.net/8S7kP/1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM