diff --git a/css/header.css b/css/header.css index 73ca3a57..82aed3d7 100644 --- a/css/header.css +++ b/css/header.css @@ -7,7 +7,7 @@ position: fixed; top: 0; left: 0; - transition: background-color var(--animation-speed-fast) ease-in-out; + transition: background-color var(--animation-speed-slow) ease-in-out; } .header-background { diff --git a/js/menu.js b/js/menu.js index 06ecfa14..2b7fa7e0 100644 --- a/js/menu.js +++ b/js/menu.js @@ -14,8 +14,13 @@ var menu = (function() { }, false); }; + var _scrollToTop = function(element) { + element.scrollTop = 0; + }; + var _tab = function(button) { var allMenuNavButton = helper.eA(".menu-nav-button"); + var menuContent = helper.e(".menu-content"); var allMenuContentArea = helper.eA(".menu-content-area"); var target = helper.e(button.dataset.target); allMenuNavButton.forEach(function(arrayItem, index) { @@ -26,6 +31,7 @@ var menu = (function() { }); helper.addClass(button, "active"); helper.removeClass(target, "is-hidden"); + _scrollToTop(menuContent); }; var close = function() { @@ -34,6 +40,7 @@ var menu = (function() { }; var open = function() { + _scrollToTop(helper.e(".menu-content")); state.get().menu.active = true; render(); }; @@ -42,6 +49,7 @@ var menu = (function() { if (state.get().menu.active) { state.get().menu.active = false; } else { + _scrollToTop(helper.e(".menu-content")); state.get().menu.active = true; }; render(); diff --git a/js/version.js b/js/version.js index 7db04485..8b42bdf1 100644 --- a/js/version.js +++ b/js/version.js @@ -1,7 +1,7 @@ var version = (function() { // version is normally bumped when the state needs changing or any new functionality is added - var current = "2.5.0"; + var current = "2.6.0"; var get = function() { var number = current.split(".");