5
我想仅在鼠标悬停目标时显示qtip(<span class="percent100">
),但我希望保持可见状态,直到将鼠标移动到包含常规元素(<div class="profileArea"
)之外。这是我试过的,但它不起作用。在包含目标的区域之外隐藏qTip
HTML:
//other HTML
//don't hide tooltip if anywhere in this div
<div class="profileArea">
<span class="profileInner">Your Profile: 0
<span class="fullProfileBar">
<span class="completedProfileBar"></span>
</span>
//start showing when hover over this span
<span class="percent100"> 100%</span>
</span>
</div>
//other HTML
的Javascript:
$('.percent100').qtip({
id: 'progressBarTooltip',
content: {
text: 'Text Here'
},
position: {
my: 'top right',
at: 'bottom right',
target: $('.percent100')
},
show: {
event: 'mouseover' //shows when hover .percent100
},
hide: {
fixed: true,
//trying to hide when leave
target: $("div[class!='profileArea']")
},
});
将jquery委托更改为on方法。 “从jQuery 1.7开始,.delegate()已经被.on()方法取代。” –