From 12ff9794d29f051b06afaa6a0695ac8880ab5ba7 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 20 Apr 2016 11:46:05 +0200 Subject: [PATCH] En fait les étoiles montent --- public/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/main.js b/public/main.js index d843412..23a8e67 100644 --- a/public/main.js +++ b/public/main.js @@ -98,11 +98,11 @@ $(function() { $('#stars img').each(function(i, el) { var e = $(el); var pos = e.position() - if (pos.top > h) { - e.css('top', '0px'); + if (pos.top < 0) { + e.css('top', h + 'px'); e.css('left', Math.floor(Math.random() * w) + 'px'); } else { - e.css('top', (pos.top + 100) + 'px'); + e.css('top', (pos.top - 100) + 'px'); } }); -- libgit2 0.21.2