scrollTop jquery, scrolling to div with id?

前端 未结 5 2036
面向向阳花
面向向阳花 2020-12-24 07:08

So this is the current code I have

$(document).ready(function() {
    $(\'.abouta\').click(function(){
        $(\'html, body\').animate({scrollTop:308}, \'s         


        
5条回答
  •  星月不相逢
    2020-12-24 07:52

    if you want to scroll just only some div, can use the div id instead of 'html, body'

    $('html, body').animate(...
    

    use

    $('#mydivid').animate(...
    

提交回复
热议问题