Javascript qtip2设置属性,但不设置';打开jquery时不显示。(鼠标悬停)
这是我用来显示QTIP的代码:Javascript qtip2设置属性,但不设置';打开jquery时不显示。(鼠标悬停),javascript,jquery,html,qtip,qtip2,Javascript,Jquery,Html,Qtip,Qtip2,这是我用来显示QTIP的代码: $(document).on('mouseover', '.sktooltip', function(event) { // Bind the qTip within the event handler $(this).qtip({ overwrite: false, // Make sure the tooltip won't be overridden once created content: 'ToolTip
$(document).on('mouseover', '.sktooltip', function(event) {
// Bind the qTip within the event handler
$(this).qtip({
overwrite: false, // Make sure the tooltip won't be overridden once created
content: 'ToolTip!',
target: 'mouse',
show: {
event: event.type, // Use the same show event as the one that triggered the event handler
ready: true // Show the tooltip as soon as it's bound, vital so it shows up the first time you hover!
}
}, event); // Pass through our original event to qTip
})
// Store our title attribute in 'oldtitle' attribute instead
.each(function(i) {
$.attr(this, 'oldtitle', $.attr(this, 'title'));
this.removeAttribute('title');
});
它与文档中的基本相同
现在,我将鼠标悬停在相关HTML上:
<div class="service-block msr">
<a target="_blank" href="http://google.de">
<div class="service-image msrc">
<img rel="254" data-original="123.png" class="sktooltip" src="123.png" style="display: inline;">
</div></a>
<h4><a target="_blank" href="http://google.de">Google</a></h4>
<p>Search Engine</p>
</div>
搜索引擎
及之后:
<div class="service-block msr">
<a target="_blank" href="http://google.de">
<div class="service-image msrc">
<img rel="254" data-original="123.png" class="sktooltip" src="123.png" style="display: inline;" data-hasqtip="0" aria-describedby="qtip-0">
</div></a>
<h4><a target="_blank" href="http://google.de">Google</a></h4>
<p>Search engine</p>
</div>
搜索引擎
正如您所看到的,qtip将其属性插入元素中,但我看不到工具提示。我错过了什么
编辑:它在这里有效,但在我的网站上无效:现在有效!我使用了jquery.同位素,它实现了imagesLoaded插件的旧版本,这导致了qTip2的问题。要解决这个问题,只需在同位素脚本之后包含最新的imagesLoaded脚本