Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
erika_barichello

Pacific Template - Anchor Scroll not working on iPad

Question

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!

Edited by erika_barichello

Share this post


Link to post

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...