If I mouseover and mouseout .activate_tooltip once, it continues to work thereafter. But the first mouseover does not trigger any action. Anyone know what causes this?
$('.task_box').delegate('.activate_tooltip', 'mouseover mouseout', function(event) {
if (event.type == 'mouseover') {
clearTimeout(timeOut);
$(this).prev().find('.tooltip_2').show();
} else if (event.type == "mouseout") {
timeOut = setTimeout(hideToolTip, 0);
}
});
<div class="edit_task_icon_div" style="position:relative;">
<div style="position:relative">
<div class="tooltip_2" style="position: absolute; top: 20px; left: -6px;">
<div class="tooltip_2_text">Edit</div>
</div>
</div>
<a href="#" id="edit_{{task.id}}" class="pencil_button activate_tooltip"></a>
</div>
Figured it out. The clearTimeout was causing the issue for some reason. It worked when I used the .hover event, but commenting it out in the delegate seemed to fix the problem. Not sure why!