position: fixed,IE6 不支援,現代瀏覽器全相容bottom,不遮擋 footer<script src="follow.js"></script>
<script>
window.onload = function () {
var els = [document.getElementById('follow'), document.getElementById('follow2')];
new Follow({ obj: els, bottom: 150 });
};
</script>
<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>Follow Demo</title>
<style>
.wrap{width:1000px;margin:0 auto}.header{height:200px;background:#1BA1E2}
.content{display:flex}.left{width:70%;background:#8CBF26;padding:50px}
.right{width:30%}.aside{height:150px;background:#F09609;margin-top:50px}
.aside2{height:150px;background:#DB4F33}.footer{height:150px;background:#666}
</style></head><body>
<div class="wrap">
<div class="header">Header</div>
<div class="content">
<div class="left"><div class="text">內容區塊...</div></div>
<div class="right">
<div class="aside" id="follow">跟隨模組 1</div>
<div class="aside2" id="follow2">跟隨模組 2</div>
</div>
</div>
<div class="footer">Footer</div>
</div>
<script src="follow.min.js"></script>
<script>window.onload=function(){new Follow({obj:[follow,follow2],bottom:150})}</script>
</body></html>
側邊廣告、客服浮動按鈕、目錄導航、購物車摘要等需隨滾動固定顯示的區塊。