• <jQuery> <方法> 十五. scrollTop()方法和scrollLeft()方法


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            body {
                width: 2000px;
                height: 2000px;
            }
        </style>
    </head>
    <body>
    
    
    <div></div>
    <input type="button" value="顶部">
    <input type="button" value="左边">
    <script src="jquery-3.2.1.js"></script>
    <script>
        $(function () {
            $(window).scroll(function () {
                // 距离上边的距离
                console.log($(window).scrollTop());
    
                // 距离左边的距离
                console.log($(window).scrollLeft());
            });
        });
    </script>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            body {
                width: 2000px;
                height: 2000px;
            }
        </style>
    </head>
    <body>
    
    
    <div></div>
    <input type="button" value="顶部">
    <input type="button" value="左边">
    <script src="jquery-3.2.1.js"></script>
    <script>
        $(function () {
            $(window).scroll(function () {
                // 距离上边的距离
                console.log($(window).scrollTop());
    
                // 距离左边的距离
                console.log($(window).scrollLeft());
            });
        });
    </script>
    </body>
    </html>
  • 相关阅读:
    owe的用法
    other,others,another,the other的区别
    国内顶尖的sql dba 团队招人。
    Sqler 工具更新
    2015 年个人计划
    在没Hadoop 、GP 前提下怎么进行实时数据统计。
    201407-至今
    Sqler-Cmd
    Sqler-Monitor
    SqlCmd -Windows Cluster Model
  • 原文地址:https://www.cnblogs.com/ZeroHour/p/8276583.html
Copyright © 2020-2023  润新知