aktuelle.kurse/m152/auftraege/x_gitressourcen/Animationen/SVG/20_SVG_Animated with JavaScript.html
harald.mueller 950589c3da muh
2023-07-22 21:01:47 +02:00

24 lines
410 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<h1>Karussell fahren</h1>
<svg>
<rect id="myRect" width="40" height="80" x="50" y="100" fill="red" />
</svg>
<script>
let y = 0;
let x = document.getElementById("myRect");
window.setInterval(function(){
y+=1;
x.setAttribute('transform','rotate(' + y + ', 50,80)');
}, 5);
</script>
</body>
</html>