summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2018-01-09 10:58:11 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2018-01-09 10:58:11 (GMT)
commit324240e2565f907f14379ad2c59119f823ffccb3 (patch)
treef10989866c7f1ae2a16b02e005e4ce8dc6561ce6
parent59b6c57fad32a1067df0134ed544b24e0b580fa2 (diff)
downloadpublik-website-324240e2565f907f14379ad2c59119f823ffccb3.zip
publik-website-324240e2565f907f14379ad2c59119f823ffccb3.tar.gz
publik-website-324240e2565f907f14379ad2c59119f823ffccb3.tar.bz2
js: don't repeat miniscreen scrolling code
-rw-r--r--static/js/combo.public.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/static/js/combo.public.js b/static/js/combo.public.js
index b46a351..0c115e4 100644
--- a/static/js/combo.public.js
+++ b/static/js/combo.public.js
@@ -9,12 +9,11 @@ $(function() {
var $window = $(window);
var offset = parseInt(Math.random()*2000);
var $ecrans = $('.ecrans');
- var pos = $window.scrollTop();
- $ecrans.css('background-position', (offset + pos/2) + 'px 0px');
$window.bind('scroll', function() {
var pos = $window.scrollTop();
$ecrans.css('background-position', (offset + pos/2) + 'px 0px');
});
+ $window.trigger('scroll');
}
if ($('div[id|=chiffres]').length) {
var $chiffres_section = $('div[id|=chiffres]');