|
From: Lasse Kärkkäi. <tr...@us...> - 2011-01-10 23:16:19
|
Module: web
Branch: master
Commit: 3048cd32250ed9d823c262c6e02c54595d5c3589
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Dec 7 00:24:21 2010 +0100
Smoother showcase scroll
---
htdocs-binary/showcase.js | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/htdocs-binary/showcase.js b/htdocs-binary/showcase.js
index b128f38..de0abf7 100644
--- a/htdocs-binary/showcase.js
+++ b/htdocs-binary/showcase.js
@@ -1,14 +1,14 @@
var img = Math.floor(Math.random() * 20);
var anim = 0;
function showcaseScroll() {
- var e = document.getElementById('showcase');
- var pos = 128 * (img + 0.5 * (1 - Math.cos(Math.PI * anim / 30)));
- e.style.backgroundPosition = Math.round(-pos) + "px 0";
var timeout = 3500;
if (anim > 0) timeout = 16;
if (anim == 30) { anim = -1; ++img; }
- ++anim;
setTimeout('showcaseScroll()', timeout);
+ ++anim;
+ var e = document.getElementById('showcase');
+ var pos = 128 * (img + 0.5 * (1 - Math.cos(Math.PI * anim / 30)));
+ e.style.backgroundPosition = Math.round(-pos) + "px 0";
}
showcaseScroll();
|