html - CSS3 Animation getting stucked until hover -
i'm doing css3 animation "blink" img on site.
my .dot black dot in page, , want blink (opacity 1 0 , backwards)
the secuence this: - load page --> animation start running - hover .dot --> animation pauses - hover out --> animation start running again
it works...but when load web, in pause mode. , when hover them, activate , start running. i'm using chrome.
some idea??
my code:
.dot { position: absolute; width: 22px; height: 22px; background-color: black; border: 4px solid white; border-radius: 99999px; cursor: pointer; -moz-animation-name: example; -o-animation-name: example; -webkit-animation-name: example; animation-name: example; -moz-animation-duration: 2s; -o-animation-duration: 2s; -webkit-animation-duration: 2s; animation-duration: 2s; -moz-animation-iteration-count: infinite; -o-animation-iteration-count: infinite; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; } .dot:hover { background-color: white; border: 4px solid black; opacity: 1; -webkit-animation: animation 1s 16 ease; -webkit-animation-play-state: paused; -moz-animation: animation 1s 16 ease; -o-animation: animation 1s 16 ease; animation: animation 1s 16 ease; -moz-animation-play-state: paused; -o-animation-play-state: paused; animation-play-state: paused; } /* animation code */ @-moz-keyframes example { {opacity: 1;} {opacity: 0;} } @-webkit-keyframes example { {opacity: 1;} {opacity: 0;} } @keyframes example { {opacity: 1;} {opacity: 0;} }
thanks @nikki 1 solution.
with js, call function when dom loaded, way force css start.
var listdot = document.getelementbyclassname("dot"); function start() { (var = 0; < listdot.length; i++) { listdot[i].style.webkitanimation = "example"; } }
Comments
Post a Comment