页面滚动到指定class样式位置

 var winTop =$(window).scrollTop();
 var top = document.getElementsByClassName('is-danger')[0].getBoundingClientRect().top;
 window.scrollTo(0,winTop-Math.abs(top))

  

posted @ 2018-07-13 10:10  748573200000  阅读(568)  评论(0编辑  收藏  举报