There is no "hover" event. You do use the mouseover
event, which (when using HTML attributes to set up) is referenced with on
in front of the event name. There won't be a problem with this event triggering even if the mouse is moving fast.
function changeDef(event){
console.log(event.target);
}
<img class="img-default" src="./img/footer1.png" onmouseover="changeDef(event)">
But, you really should not use the 25+ year old technique of setting up event handlers via HTML attributes (which introduces a variety of issues) and, instead, follow modern standards and best practices by separating the JavaScript from the HTML:
// Get a reference to the element that you want to work with
var img = document.querySelector("img.img-default");
// Set up an event handler. Notice that we don't use "on" in front
// of the event name when doing it this way.
img.addEventListener("mouseover", changeDef);
function changeDef(event){
console.log(event.target);
}
img { width:50px; }
<img class="img-default" src="http://cdn.schoolstickers.com/products/en/819/GREEN-SMILE-00.png">
Now, in CSS, there is a hover "state" that an element can be in, and if you just want to change styling of the element, you don't need any JavaScript at all:
img { width:50px; border:2px solid rgba(0,0,0,0); }
img:hover { border:2px solid red; }
<img class="img-default" src="http://cdn.schoolstickers.com/products/en/819/GREEN-SMILE-00.png">