misc: add a class to <body> once the user scrolled the page a bit (#31094)

This commit is contained in:
Frédéric Péters 2019-03-05 14:15:48 +01:00
parent f2fd2225fd
commit d8068a046a
1 changed files with 9 additions and 0 deletions

View File

@ -214,6 +214,15 @@ $(function() {
return false;
});
/* add a scrolled class to body once the user scrolled the page a bit */
$(window).on('scroll', function() {
if ($(window).scrollTop() == 0) {
$('body').removeClass('scrolled');
} else {
$('body').addClass('scrolled');
}
});
$('body').on('click', 'a.calchunk', function(event){
event.preventDefault();
var $elem = $(this);