zoukankan      html  css  js  c++  java
  • 判断页面中是否有滚动条

    <!doctype html>
    <html><head>
        <meta charset="utf-8">
        <title>一篇很长的文章</title>
        <script language="javascript" src="jquery-1.4.4.min.js"></script>
        <script language="javascript">
            $(document).ready(function(){
                /*if (document.documentElement.clientWidth > document.documentElement.offsetWidth-4){
                    alert("有滚动条");
                }*///思路是判定可视窗口高度或宽度是否小于实际页面高度或宽度
                $("body").scrollTop(10);//控制滚动条下移10px
                if( $("body").scrollTop()>0 ){
                    alert("有滚动条");
                }else{
                    alert("没有滚动条");
                }
                $("body").scrollTop(0);//滚动条返回顶部
            });
        </script>
    </head>
    <body>
    <p>。。。。。。。。</p>
    </body>
    
    </html>

  • 相关阅读:
    hdu 2196(树上点分治)
    hdu 4807(网络流 + 贪心)
    hdu4101
    hdu4216
    hdu 4219, 树形概率DP
    hdu 4127 A*搜索
    hdu 4126
    hdu 5296,15年多校1-7
    poj3436 ACM Computer Factory
    Fence
  • 原文地址:https://www.cnblogs.com/mina-huojian66/p/6150271.html
Copyright © 2011-2022 走看看