Guest Posted November 24, 2020 Posted November 24, 2020 Hi im trying to add an anchor link into my website and want it to smooth scroll to it. Unfortunately I cannot find a way to make it work with safari, it works with chrome I have enabled smooth scroll in Design > Custom CSS
misterdega Posted December 4, 2020 Posted December 4, 2020 Did you ever find a solution? I found the following. It works to smooth scroll in Safari and Chrome, but the problem is that it has bugs when on mobile. When you are vertical and you click a link in the dropdown hamburger menu, the menu gets stuck at the top of the site and the website seems to be frozen. SMOOTH SCOLL (works in both Chrome and Safari but gives bugs to safari mobile) CSS injection html { scroll-behavior: smooth; } Header Injection <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script> Footer Injection <!-- smooth scrolling --> <script type="text/javascript"> $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); </script>
misterdega Posted December 7, 2020 Posted December 7, 2020 Ok I got a solution! It isn't free though. I had this add on before but it bugged out recently. I was working with their support team and got it all ironed out. Works in mobile, safari, chrome and all. Check out my website shootlorenzo.com And the add on is here. https://www.squareaddons.com/shop-2/p/anchor-linking So relieved..
Recommended Posts
Archived
This topic is now archived and is closed to further replies.