Hey guys so I'm working on animating my java script for a project, and being a newbie at java-script I have only figured out how to make my image move up and down in a set area. How can make my object "dank" also spin 360 infinitly whiles using the following code to move it up and down? Any help is appreciated!
window.addEventListener("load", function() {
function myMove() {
var elem = document.getElementById("dank");
var pos = 100;
var id = setInterval(frame, 10);
function frame() {
pos += 0.3;
elem.style.top = pos + "px";
if (Math.abs(pos) >= 250){
pos = 100;
}
frame();
}
}