fix scrolltop cross-browser compat.

This commit is contained in:
wgroeneveld 2020-05-25 20:49:24 +02:00
parent 8fd84e2df4
commit e01a798912
2 changed files with 1 additions and 2 deletions

View File

@ -3,7 +3,6 @@ html
font-size: 1.0rem
@media (min-width: 960px)
font-size: 1.15rem
height: 100%
body, h1, h2, h3, h4, .content-column-content p, .content-column-content li, .box-masonry .box-masonry-text p

View File

@ -29,7 +29,7 @@ $(function() {
function scrollThenFixSidebar() {
var maxHeight = $('.sidebar-content').height() - $(window).height() + 40;
$('body').on('scroll', function(e) {
$(document).on('scroll', function(e) {
var s = document.scrollingElement.scrollTop || $('html').scrollTop() || $('body').scrollTop();
if(s > maxHeight) {
$('.sidebar-content').addClass('sidebar-fixed').removeClass('sidebar-scrolling');