javascript – LINK Anchor to Section Not Working in FireFox


$(window).load(function() {
  $('a.scroll').each(function() {
    var id = $(this).attr('href');
    if (id.match('^#')) {

      var target = $(id).offset().top - 65;
      var title = $(this).attr('title');

      $(this).on('click tap', function() {
          scrollTop: target
        }, 1000);
          foo: title
        }, title, id);
        return false;

same page

<a href="pecas-servicos#qualidade" class="scroll" title="{!! trans('')">Qualidade</a>

Another Page

<a href="pecas-servicos/contato#qualidade" class="scroll" title="{!! trans('')">Qualidade</a>

When I'm on the HOME page and I click on the LINK it works scrolling to the section I clicked on.

But if I'm on another page the same doesn't happen. It even goes to HOME, however, it goes down to the bottom of the page.


It does not recognize the post via strange Script not working only in Firefox. Two things I would try.

  1. Placing the Full URL follows a test I put on my site ( );
  2. Force the URL by taking the parameter and find the correct part of the page like this ( );

Tell me later if any of them worked.

Scroll to Top