Xenocide112 Posted January 26 Posted January 26 site URL: https://marsplanetarium.com Hello, I'm having a little bit of trouble getting my navigation links to do exactly what I want. I have the anchors all set up and working correctly, but only if you click on them from the home page. 99% of my site is all on the one home page, and I set up my header navigation links to smooth scroll to different sections, like #contact or #events, which is how they are set up in navigation. The problem is that if I add a separate "About" page, the navigation links seem to be looking for the anchor tags on the About page, where there are none. I can fix it by including the whole site url in the navigation links (http://marsplanetarium/home/#contact) but then it always reloads the page, even when I click on them from the home page. This defeats the purpose of the smooth scrolling. Is there a way to have both smooth scrolling without reloading on the homepage, but also jumping from About to Home and then the anchor when clicking from the about page? Thanks in advance! Jacobibrahim 1
tuanphan Posted January 28 Posted January 28 Change /home/ from url to / Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Xenocide112 Posted January 28 Author Posted January 28 It looks like that is till reloading the page each time I click the link, the same as it was when i had /home/ in it
tuanphan Posted January 30 Posted January 30 If your site is one page only, you can use this #contact (remove / in the url) But if your site has >1 page, when you are on another page, click this anchor link, it will do nothing Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment