From b56ed00dc5e5b2f1cbbbe086e7a50c79719f03dd Mon Sep 17 00:00:00 2001 From: bergware Date: Tue, 30 Oct 2018 08:39:14 +0100 Subject: [PATCH] Code optimization --- plugins/dynamix/include/DefaultPageLayout.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/dynamix/include/DefaultPageLayout.php b/plugins/dynamix/include/DefaultPageLayout.php index 449ff8b2a..f9c0afdcb 100644 --- a/plugins/dynamix/include/DefaultPageLayout.php +++ b/plugins/dynamix/include/DefaultPageLayout.php @@ -497,7 +497,8 @@ $(window).scroll(function() { $('.back_to_top').fadeOut(backtotopduration); } - $('div#menu').css($(this).scrollTop() > $('div#header').height() ? {position:'fixed',top:'0'} : {position:'absolute',top:'90px'}); + var top = $('div#header').height() - 1; // header height has 1 extra pixel to cover overlap + $('div#menu').css($(this).scrollTop() > top ? {position:'fixed',top:'0'} : {position:'absolute',top:top+'px'}); }); $('.back_to_top').click(function(event) {