Js follow scrolling effect plug-in
supports defining multiple follow IDs, uses css fixed attributes, does not support ie6, and is compatible with other mainstream browsers.
Supports defining the minimum height for scrolling to the bottom without covering the bottom
After the page size is resized, the plug-in will automatically reset the parameters
========
Js follow scrolling effect plug-in
1. Supports defining multiple follower IDs, using css fixed attributes, not supporting ie6, and compatible with other mainstream browsers.
2. Supports defining the minimum height for scrolling to the bottom without covering the bottom
3. After the page size is resized, the plug-in will automatically reset the parameters
========
How to use
The code is as follows
window.onload = function(){
var followIds = [document.getElementById("follow"),document.getElementById("follow2" )];
new Follow({
obj:followIds,
bottom:150
});
}
Complete example
The code is as follows
Js Follow
使用方法:
1.载入插件,在页面载入之后,window.onload = function(){}
2.创建需要跟随的对象的数组,比如 var followIds = [document.getElementById("follow"),document.getElementById("follow2")];
3.初始化Follow:new Follow();
4.传参,obj是对象数组,bottom是滚动块距离底部的最小的高度
<br><script type="text/javascript" src="follow.js"></script><br>window.onload = function(){<br> var followIds = [document.getElementById("follow"),document.getElementById("follow2")];<br> new Follow({<br> obj:followIds,<br> bottom:150<br> });<br>}<br>
<script><br>window.onload = function(){<br> var followIds = [document.getElementById("follow"),document.getElementById("follow2")];<br> new Follow({<br> obj:followIds,<br> bottom:150<br> });<br>}<br></script>