Commit 12ff9794d29f051b06afaa6a0695ac8880ab5ba7
1 parent
893c4e9a
En fait les étoiles montent
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
public/main.js
@@ -98,11 +98,11 @@ $(function() { | @@ -98,11 +98,11 @@ $(function() { | ||
98 | $('#stars img').each(function(i, el) { | 98 | $('#stars img').each(function(i, el) { |
99 | var e = $(el); | 99 | var e = $(el); |
100 | var pos = e.position() | 100 | var pos = e.position() |
101 | - if (pos.top > h) { | ||
102 | - e.css('top', '0px'); | 101 | + if (pos.top < 0) { |
102 | + e.css('top', h + 'px'); | ||
103 | e.css('left', Math.floor(Math.random() * w) + 'px'); | 103 | e.css('left', Math.floor(Math.random() * w) + 'px'); |
104 | } else { | 104 | } else { |
105 | - e.css('top', (pos.top + 100) + 'px'); | 105 | + e.css('top', (pos.top - 100) + 'px'); |
106 | } | 106 | } |
107 | }); | 107 | }); |
108 | 108 |