Hi Jesse,
That’s right, I’m able to see the issue because I checked it on bigger screen, and the code is actually working. I didn’t said the code wasn’t working but different conditions applied (like screen size vs content size). I’ll explain how it works
var contactPosition = jQuery('#contact').offset();
This gets the offset
position of the contact section.
if (window.scrollY + 600 >= contactPosition.top && jQuery('#menu-item-66').hasClass('current-menu-item') == 0 ) {
This check if windows scroll top overlaps with contact section offset
. Which means if scroll position is less than or equal to 1700px (contact section’s offset
's top position). Then it will add the current men
u status, but how about the built-in ScrollLibrary that function the same? It will still select the section that is behind the navbar. I’ll provide the screenshot to explain this further.
Now based on that visual guide, to which area the navigation still belong (touch/overlaps) even though you’re already at the end of the page? It still the Pricing Area, hence, it switches back to Pricing menu item even though you click the Contact menu item.
The problem now is, it only works when scrolling to that section with the mouse, not when clicking on the menu item.
The code is intentionally for scroll and not for click action. window.onscroll = function(ev) {
My answer about this issue is still the same as I previously provided , or do you just wish to make the last section full-screen so it would cover the entire area regardless of screen?
Thanks!