使用Jq进行锚点定位

 
  1. <script>

  2. $(document).ready(function(){

  3. $('html, body').animate({scrollTop: $('.listbox1').offset().top}, 300)

  4. });

  5. </script>