header behavior

Topic summary

A user encountered an issue where header navigation links worked correctly on the homepage but failed to redirect when clicked from other pages (specifically service detail pages). The links were set up to navigate to different sections of the homepage.

Solution Process:

  • Modified JavaScript code to detect when users are on non-homepage pages
  • Updated the code to redirect users back to the homepage first, then scroll to the targeted section
  • Initial fix worked for “About” and “Contact Me” sections but not for “Services” and “Clients”
  • A comprehensive JavaScript solution was provided to handle all sections

Final Adjustment:

  • The redirects worked but were cutting off section titles due to the sticky header (73px height) overlapping the content
  • Additional JavaScript code was added to account for the header height offset when scrolling

Status: Issue resolved. All header navigation links now properly redirect from any page to the correct homepage sections with proper positioning.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

Hi,

I set the header so it can redirect to each part of the home page,

currently working well.

The small problem occur when i move to other page from “Services”.

when I pick one of my services, and inside the page, clicking on the header wont send me anywhere.

Is it possible to redirect to the home page to the exact section selected? (same behavior as homepage)

Warm regards.

https://wmqgez-r2.myshopify.com/

  1. first pick a service from home page

2.Then try to use the header’s subjects.

Hi @Artez

I think we need to modify the previous js code to cover case other pages.

If customer at other page, we will redirect them to home page then scroll to exactly that section

Hi @Artez

can you try to replace the old code with this one:


1 Like

Wow it work well for “about” and “contact me” the only two left to take care of are “services” and “clients”.

Would be amazing if you succeed dear friend.

Warm regards.

That sounds great.

Let remove the old JS code with this one. All with only this one:


So close dear friend, it redirect correctly,

one question:

Is it possible to redirect to the top of each topic, it look like it cut the words Client, and also the same about “about”, when redirected from the precious page, it redirect correctly but cut the titles, thank you very much :raising_hands:

Actually it was scroll to exactly section with id corresponding, the reason of cut off text is because your header sticky have height is 73px so that over the text.

Let try to add this JS code to whether it can handle the issue for you:


1 Like

You rock Dear friend! working amazing!

1 Like

You’re welcome :face_savoring_food:

1 Like