- This topic has 13 replies, 3 voices, and was last updated 2 years, 11 months ago by Tom.
May 18, 2018 at 1:57 pm #579170Mike
It seems the new smooth-scroll class works as intended if the anchor link is the simple a href=”#id”
But if I use it on a full link like this:
a herf=”http://www.mysite.com/#id” or a relative root path like /path/#id
Then clicking the link simply does nothing at all. The link becomes “dead”.
As you can see, sometimes we do need to use the full path links for things like in the navigation menu, because not all the anchors will be on the same page. If it won’t do smooth scroll when pointed to a different page, it should at least follow the link, so basically smooth if the user is on the same page, and no smooth if on different page.
Could you please take a look into this?
Thanks.GeneratePress 2.1.2GP Premium 1.6.2May 18, 2018 at 9:23 pm #579290TomLead DeveloperLead DeveloperMay 19, 2018 at 1:15 am #579340Mike
I updated the URL of my development site. The link examples in question:
“Why Choose Us” on the top menu has just the relative #link, it works.
“Industries” has full path. It doesn’t work.
Thanks.May 19, 2018 at 4:15 am #579394DavidStaffCustomer SupportMay 19, 2018 at 1:05 pm #579709Mike
The Max Mega Menu doesn’t have its own smooth scroll, it just copies every CSS class of the menu and add a mega- prefix to them. The basic smooth-scroll class still remains.
I tried non-menu links. For example, links in the body of the page (see the “common issues” link), and it behaves the same. Full path + smooth-scroll = dead link.
Thanks.May 19, 2018 at 9:02 pm #579830TomLead DeveloperLead Developer
So let’s look at the common issues button. If you remove the
/from in front of the URL, it works?
I’ll dig into the code and see if I can find the issue.May 19, 2018 at 11:06 pm #579855Mike
Yes sir, removing / and it works, just like the green and blue buttons.
I also tried disabling Autoptimize, no difference.
I then deactivated every single plugin I have (Autoptimize, Max Mega Menu, Smart Slider 3), leaving only GP of course:), no difference either.May 20, 2018 at 9:13 am #580150TomLead DeveloperLead DeveloperMay 22, 2018 at 9:06 am #581851Mike
Is this something that happens with my site only? Do full path links with hash tags like http://yoursite.com/#link with the new GP smooth-scroll class added and smooth-scroll enabled work for everyone else?May 22, 2018 at 6:56 pm #582208TomLead DeveloperLead DeveloperMay 22, 2018 at 8:49 pm #582251Mike
Changed to full URL and doesn’t work. It was actually through the full URL that I found out it didn’t work…
Anything except straight away #tag doesn’t seem to work.May 22, 2018 at 8:57 pm #582259TomLead DeveloperLead Developer
That’s really strange – here’s what I’m getting: http://tomusborne.com/dev/?page_id=13766
I wonder if there’s a conflicting smooth scroll script on your site?May 22, 2018 at 9:15 pm #582277Mike
I solved it—by upgrading to GP Premium 1.6.2 from 1.6.1. I just realized I was still on 1.6.1 because I run IIS and have to delete GP/re-install GP every time I want to upgrade GP due to that long directory name bug.
But I didn’t upgrade because I thought 1.6.2 was the same as 1.6.1 except for the PHP warning for GP sites issue. Because I didn’t have that problem I thought I’d just skip 1.6.2 and wait for 1.6.3.
But who knows upgrading to 1.6.2 actually solved the problem. Something must have changed between .1 and .2 I guess. What a coincidence.
Thanks Tom for the effort to look into my issue.May 22, 2018 at 9:18 pm #582279TomLead DeveloperLead Developer
Strange – nothing changed in the script between those two versions. Maybe updating cleared some caches.
Glad it’s working now 🙂
- You must be logged in to reply to this topic.