0
다른 요소 (#hover) 안에 요소 (#hastitle)에 대한 툴팁이 필요합니다. 이벤트 전파를 중지하고 mouseover/mouseout에서 작업을 수행합니다.jQuery UI 위에 숨은 요소 위 툴팁
HTML :
<div id="hover">
<div id="hastitle" title="bar">fu</div>
</div>
JS :
$('#hover').on('mouseover mouseout', function (e) {
e.stopPropagation();
$(this)[e.type == 'mouseover' ? 'addClass' : 'removeClass']('hover');
});
$(document).tooltip({
tooltipClass: 'tip'
});
왜 툴팁이 작동하지 않는 이유는 무엇입니까?
해결 방법 : 도구 설명 (#hover)이 아직없는 요소에 대해 mouseover/mouseout에서 e.stopPropagation()
을 호출할지 여부가 확실하지 않습니다. 두 가지 경우 모두에 적용되는 솔루션은 대단히 감사하겠습니다.