1.载入插件,在页面载入之后,window.onload = function(){}
2.创建需要跟随的对象的数组,比如 var followIds = [document.getElementById("follow"),document.getElementById("follow2")];
3.初始化Follow:new Follow();
4.传参,obj是对象数组,bottom是滚动块距离底部的最小的高度
<script type="text/javascript" src="follow.js"></script> window.onload = function(){ var followIds = [document.getElementById("follow"),document.getElementById("follow2")]; new Follow({ obj:followIds, bottom:150 }); }