如上圖,頂部版權是用絕對定位寫的,被頂上去了,解決方法是判斷屏幕大小,改變footer的定位方式:javascript
<script> var oHeight = $(document).height(); //瀏覽器當前的高度 $(window).resize(function(){ if($(document).height() < oHeight){ $(".footer").css("position","static"); }else{ $(".footer").css("position","absolute"); } }); </script>