Let's invoke a function on the jQuery hover() event!
We're completing these tasks in Submlime and the console.
This is an example of a hover function:
$("mySelector").hover(function() { // hover in statement }, function() { // hover out statement });
The button abovce has an ID of button
.
ready()
function.ready()
function, add the function above using the selector #button
.console.log("hovering button");
inside the hover in handler of the hover function.
// hover in statement
console.log("not hovering button");
inside the hover out handler of the hover function.
// hover out statement
hovering button
and not hovering button
when those events occur.