I am trying to show a tooltip if a searchfield got a empty value. After the Tooltip is shown, i want to bind a click function to the body to hide the tooltip again. But for some reason after adding the bind command to the click function, the tooltip wont even appear. I already checked the console, but without any results. Here is my Code:
$('#search_top .search_click').click(function() {
if($('#search_top #suchfeld').val() == '') {
$('.search_tooltip, .search_tooltip:after').css('display', 'block');
$('.search_tooltip, .search_tooltip:after').addClass('active');
$('body').bind('click', closeTip);
}
else {
$('#search_top').submit();
}
});
function closeTip() {
$('.search_tooltip, .search_tooltip:after').css('display', 'none');
}
Anyone got an idea?