- This topic has 13 replies, 3 voices, and was last updated 5 years, 10 months ago by Tom.
-
AuthorPosts
-
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.
May 18, 2018 at 9:23 pm #579290TomLead DeveloperLead DeveloperThat’s strange – I can’t replicate that issue. Can you add the URL to your site within the URL field of your original post?
May 19, 2018 at 1:15 am #579340MikeHello Tom,
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 SupportHi Mike, i think smooth scroll is for use with the GP navigation and not the mega menu, which looking at the markup seems it has its own smooth scroll function (?)
May 19, 2018 at 1:05 pm #579709MikeThe 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 DeveloperSo 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 #579855MikeYes 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 DeveloperThanks for the additional info – will look into it ASAP 🙂
May 22, 2018 at 9:06 am #581851MikeIs 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 DeveloperThe full URL like that should work fine.
On your site, it seemed you only had a slash in front of the anchor.
May 22, 2018 at 8:49 pm #582251MikeChanged 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 DeveloperThat’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 #582277MikeI 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 DeveloperStrange – nothing changed in the script between those two versions. Maybe updating cleared some caches.
Glad it’s working now 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.