5
Chciałbym pokazać qtip tylko po najechaniu myszką na cel (<span class="percent100">
), ale chcę pozostać widoczny, dopóki nie przesunę myszki poza element zawierający element ogólny (<div class="profileArea"
). Oto, co próbowałem, ale to nie działa.Ukryj qTip, gdy poza obszarem zawierającym cel
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']")
},
});
Zmień delegację jquery na metodę. "Od wersji jQuery 1.7 metoda .delegate() została zastąpiona metodą .on()." –