如何向下滚动 – JQuery

我不是程序员,但我使用下面的代码将页面滚动到顶部。

如何调整它以使向下滚动?

     $('.btnMedio').click(function(){ $('html, body').animate({scrollTop:1000},'50'); });  

 $('.btnMedio').click(function(event) { // Preventing default action of the event event.preventDefault(); // Getting the height of the document var n = $(document).height(); $('html, body').animate({ scrollTop: n }, 50); // | | // | --- duration (milliseconds) // ---- distance from the top }); 

试试这个:

 window.scrollBy(0,180); // horizontal and vertical scroll increments 

我主要使用以下代码向下滚动

 $('html, body').animate({ scrollTop: $(SELECTOR).offset().top - 50 }, 'slow'); 

这可以用来解决这个问题

 

在JavaScript中使用此

 jQuery("div#scrol").scrollTop(jQuery("div#scrol")[0].scrollHeight); 
  jQuery(function ($) { $('li#linkss').find('a').on('click', function (e) { var link_href = $(this).attr('href') , $linkElem = $(link_href) , $linkElem_scroll = $linkElem.get(0) && $linkElem.position().top - 115; $('html, body') .animate({ scrollTop: $linkElem_scroll }, 'slow'); e.preventDefault(); }); });