diff --git a/web/_includes/top.html b/web/_includes/top.html index 3634419..77c7233 100644 --- a/web/_includes/top.html +++ b/web/_includes/top.html @@ -35,13 +35,16 @@ let background = $(".top"); background.css("background-position", `${x}% ${y}%`); - setInterval(function () { - x += addX; - y += addY; - if (x < 0 || x > 100) - addX *= -1; - if (y < 0 || y > 100) - addY *= -1; - background.css("background-position", `${x}% ${y}%`); - }, 30); + + $(window).on("load", function () { + setInterval(function () { + x += addX; + y += addY; + if (x < 0 || x > 100) + addX *= -1; + if (y < 0 || y > 100) + addY *= -1; + background.css("background-position", `${x}% ${y}%`); + }, 30); + }); \ No newline at end of file