Hello.
I have 2 questions regarding the one page menu.
Question 1:
I couldnt get the menu to scroll properly when i pressed the menu items.
I found out that was a bug in the new version.
So i added this code which i found here on the forum:
jQuery(document).ready(function($) {
function scrollToSection(event) {
event.preventDefault();
var $section = $($(this).attr(‘href’));
$(‘html, body’).animate({
scrollTop: ($section.offset().top - $(’.x-navbar-wrap’).outerHeight())
}, 1000);
}
$(’.menu-item a’).on(‘click’, scrollToSection);
}(jQuery));
It now scrolls.
But after a click or 2 it starts lagging heavily?
Is there anything in the code that does it or is it too heavy pictures on the site?
Question 2:
How do i make the “Hjem”(Home button) button scroll to the top and show as active all the way down to the next item.
I just linked it to #top. That works, but the active disapers until i scroll down a bit.
Site im referring to is : www.luftspeil.no
Thanks in advance!