Problems with href scrolling for content on the same page at lower resolutions

0

My problem is this.

<a href="#saibamais" class="scroll-to">
  Saiba Mais
</a>

<div id="saibamais"></div>

$('a.scroll-to').on('click', function (e) {
   e.preventDefault();
$('html,body').animate({scrollTop: ($($(this).attr('href')).offset().top - 0)}, 600);});

On screens larger than 992 works normally, but changing the resolution from 992 down does not work anymore.

    
asked by anonymous 27.06.2018 / 14:14

1 answer

0

Strange here on the website is working perfectly.

$('a.scroll-to').on('click', function() {
  $('html,body').animate({
     scrollTop: ($($(this).attr('href')).offset().top - 0)
  }, 600);
});
#saibamais{
  margin-top: 800px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><ahref="#saibamais" class="scroll-to">
  Saiba Mais
</a>

<div id="saibamais">DIV SAIBAMAIS</div>
    
27.06.2018 / 14:30