jq动画效果慢慢滚动到固定位置

  1. function contentTop(top){  
  2.        $('body,html').animate({  
  3.                scrollTop: top  
  4.            }, 500  
  5.        );  
  6.    }  

获取元素top传入即可

[html] view plain copy
 
 在CODE上查看代码片派生到我的代码片
    1. contentTop($("#top8").offset().top);  
posted @ 2017-02-28 09:55  疯子110  阅读(2322)  评论(0编辑  收藏  举报