Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to add animation over image in Javascript

function startAnimation() {
    var frameHeight = 102;
    var frames = 15;
    var frame = 0;
    var div = document.getElementById("animation");
    setInterval(function () {
        var frameOffset = (++frame % frames) * -frameHeight;
        div.style.backgroundPosition = "0px " + frameOffset + "px";
    }, 100);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to build a string javascript es6 
Javascript :: javascript advanced concepts 
Javascript :: vars javascript 
Javascript :: javascript array looping 
Javascript :: javaScript Math.log() Method 
Javascript :: React_Weather_APp 
Javascript :: discord.js command cooldown 
Javascript :: ssl certificate nodejs 
Javascript :: react-validex 
Javascript :: post json array data curl 
Javascript :: id in class selector jquery 
Javascript :: ng class project 
Javascript :: quadratic equation in js by function 
Javascript :: set methods in js 
Javascript :: js xor 
Javascript :: js get external script to currnet page 
Javascript :: set twig variable from javascript 
Javascript :: javascript console log current directory 
Javascript :: javascript regular expression methods 
Javascript :: formidable form node js 
Javascript :: read more/less button with smoth expand 
Python :: jupyter notebook warning off 
Python :: display all columns in pandas 
Python :: how to install matplotlib in python 
Python :: python windows get file modified date 
Python :: get gpu device name tensorflow 
Python :: mac upgrade python to 3.8 
Python :: python delay 
Python :: get stats from array python 
Python :: pandas replace null with 0 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =