Skip to content

Instantly share code, notes, and snippets.

@vladyio
Created November 27, 2016 14:40
Show Gist options
  • Save vladyio/2d80b323b82a3e0f203567864b39d13e to your computer and use it in GitHub Desktop.
Save vladyio/2d80b323b82a3e0f203567864b39d13e to your computer and use it in GitHub Desktop.
<html>
<head>
<style>
div {
position:relative;
}
</style>
<title>Animating block</title>
<script>
var pos = 0;
function move() {
pos += 5;
if (pos > 640) {
pos = 0;
}
document.getElementById("movetext").style.left = pos;
window.setTimeout("move();", 33);
}
</script>
</head>
<body onLoad="move();">
<div id="movetext">
<b>inside a div</b>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment