js: add flag to disable header image animation (#19185)

This commit is contained in:
Frédéric Péters 2017-10-03 22:25:45 +02:00
parent d1d6ad4694
commit a3374a5841
1 changed files with 5 additions and 3 deletions

View File

@ -347,9 +347,11 @@ var gadjo_js = gadjo_js || {};
if ($('#sidepage').length == 1) {
$('body').attr('data-has-sidebar', 'true');
}
/* 440 is header image height (500px) - header height (60px) */
var timestamp = ((new Date().getTime() / 1000) % 86400 ) / (86400 / 440);
$('div#header').css('background-position', '0 -' + timestamp + 'px');
if ($('body[data-no-moving-header]').length == 0) {
/* 440 is header image height (500px) - header height (60px) */
var timestamp = ((new Date().getTime() / 1000) % 86400 ) / (86400 / 440);
$('div#header').css('background-position', '0 -' + timestamp + 'px');
}
/* add × to close notification messages */
$('.messages > li').each(function(idx, elem) {