Pretendo pasar esta animacion de parpadeo de css a javascript(lo quiero activar desde javascript)
#formulario:hover{
/*position: absolute;*/
animation-name: parpadeo;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
-webkit-animation-name:parpadeo;
-webkit-animation-duration: 1s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
}
@-moz-keyframes parpadeo{
0% { opacity: 1.0; }
50% { opacity: 0.0; }
100% { opacity: 1.0; }
}
@-webkit-keyframes parpadeo {
0% { opacity: 1.0; }
50% { opacity: 0.0; }
100% { opacity: 1.0; }
}
@keyframes parpadeo {
0% { opacity: 1.0; }
50% { opacity: 0.0; }
100% { opacity: 1.0; }
}
estaba intentando pasar a js asi:
window.addEventListener('load', inicio );
function inicio(){
alert("hol");
var formulario=document.getElementById('formulario');
formulario.addEventListener('mouseover', encima);
}
function encima(evt){
var formulario=document.getElementById('formulario');
formulario.style.opacity = "0.5";
}
pero no esta reconociendo el alert