5
Tôi muốn chỉ hiển thị qtip khi di chuột qua mục tiêu (<span class="percent100">
), nhưng tôi vẫn muốn hiển thị cho đến khi di chuyển chuột ra ngoài phần tử chứa chung (<div class="profileArea"
). Đây là những gì tôi đã thử, nhưng nó không hoạt động.Ẩn qTip khi nằm ngoài vùng chứa mục tiêu
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']")
},
});
Thay đổi ủy nhiệm jquery thành phương thức bật. "Như của jQuery 1.7, .delegate() đã được thay thế bằng phương thức .on()." –