hover over js code example

Example 1: javascript hover event

element.onmouseover = function() {
  //Hovering
}

Example 2: hover con js

// Creamos el evento mouseover para cada imagen
	imagenes[i].addEventListener("mouseover", function(e){
		document.getElementById("mostrar").style.backgroundImage="url('"+e.target.currentSrc+"')";
	});
 
// Creamos el evento mouseout para cada imagen
imagenes[i].addEventListener("mouseout", function(e){
  document.getElementById("mostrar").style.backgroundImage="";
});

Example 3: on hover event

onmouseover event

Tags:

Css Example