I am trying to fade in content when the mouse moves (similar to the way Google's homepage does), however I want to prevent this behaviour if the mouse cursor is hovering over a specific div.
Here's the basics:
$("html").hover(function() {
$("#navigation, #content").fadeIn("slow");
});
This successfully fades in the content. I have been trying to detect when the cursor is over a certain element but with no effect. This is what I have:
$("html").one("mousemove", function() {
if (mouseover == false) {
$("#navigation, #content").fadeIn("slow");
}
});
var mouseover = false;
$('#hero').mouseenter(function() {
mouseover = true;
}).mouseleave(function() {
mouseover = false;
});
There may be a better way to accomplish this than what I have here?