erika_barichello Posted September 15, 2019 Share Posted September 15, 2019 Hello!I'm creating a website using the Pacific Template. All anchor links from the main navigation work perfectly on desktop, but on tablets they don't scroll but just jump to the correspondent section. I solved the problem on phones where I use the hamburger menu with the following code (by @Manmeet ) , but on Ipad, where I still use the main navigation menu nothing happens. $(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; } } }); }); Does anybody knows how to solve the problem?Thank you! Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.