How to scroll to the particular div using jquery or javascript

后端 未结 5 992
耶瑟儿~
耶瑟儿~ 2021-02-07 16:25

I want to scroll to the particular div using jquery

I have written the code like:

 $(\"#button\").on(\'click\',function(){
     var p = $(\"#dynamictabst         


        
5条回答
  •  孤独总比滥情好
    2021-02-07 17:15

    You can set offset as per requirement

    jQuery(document).ready(function(){
    function secOffset(){
                            jQuery('html, body').animate({
                            scrollTop: jQuery(window.location.hash).offset().top - 60
                    }, 0);
            }
    });
    

提交回复
热议问题