Scroll to a particular element w/ jQuery

后端 未结 3 692
情深已故
情深已故 2021-01-03 00:33

I have a long list of nested divs. I am passing the ID of a particular element (actually a paragraph element) on the querystring and opening its div and parent onload. How

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-03 01:03

    You could use the scrollIntoView function.

    $(document).ready(function() {
      $('#divN').get(0).scrollIntoView();
    });
    

提交回复
热议问题