The hover()
function in jQuery takes 2 functions as parameters
$("#trigger1").hover(
function(){
$("#tooltip1.tooltipContent").show(); // show() takes care of display block
},
function(){
$("#tooltip1.tooltipContent").hide(); // hide() takes care of display none
}
);
In your example perhaps .toggle()
is more suited
$("#trigger1").hover(
function(){
$("#tooltip1.tooltipContent").toggle();
}
);
Check the jQuery API page: