js: don't repeat miniscreen scrolling code
This commit is contained in:
parent
59b6c57fad
commit
324240e256
|
@ -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]');
|
||||
|
|
Loading…
Reference in New Issue