What is the right way to attach both hover and onclik functionality on the same div?
Here’s what I tried but it didn’t work (clicking does nothing):
$(function outlineHider(){
$("#hotspot").hover(
function() {
$("#outlines").show(); //showing another div element
function bindClick() {
$("#hotspot").click(callAnotherFunction())};
},
function() {
$("#outlines").hide();
}
);
});
Try this:
Or a shorter version, with thanks to @VisioN: