类似校内的右下角漂浮效果

<!--对比弹窗js-->
<div id="float" style="position:absolute;"><a href="javascript:void(0);" onclick="gotop();" title="返回顶部" rel="nofollow"><img src="http://images.cnblogs.com/index_up.gif" alt=""/></a></div>
<script language="javascript">
    function gotop(){
        document.documentElement.scrollTop = 0;
    }
    function rightBottomAd() {
        var abc = document.getElementById("float");
        abc.style.top = document.documentElement.scrollTop + document.documentElement.clientHeight - 55 + "px";
        abc.style.left = document.documentElement.scrollLeft + document.documentElement.clientWidth - 55 + "px";
        setTimeout(function() { rightBottomAd(); }, 50);
    }
    rightBottomAd();
</script>

原文地址:https://www.cnblogs.com/wpcnblog/p/2231340.html