zoukankan      html  css  js  c++  java
  • 锚点

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>锚点</title>
    <style>
    *{padding:0;margin:0;}
    div {
    height: 800px;
    400px;
    border: 2px solid black;
    }
    h2 {
    position: fixed;
    margin:50px 500px;
    }
    a{200px;height:60px;font-size:20px;display:inline-block;line-height:60px;border:0px solid red;text-decoration: none;color:#000;}
    a:hover{color:red;}
    a:active{color:#000;}
    /*
    a:link {color:green;} 未被访问的链接
    a:visited {color:blue;}已被访问的链接
    a:hover {color:gray;}鼠标指针移动到链接上
    a:active {color:yellow;}正在被点击的链接
    */
    </style>
    </head>
    <body>
    <h2>
    <a href="#div1" style="border-bottom:3px solid lime;">to div1</a>
    <a href="#div2">to div2</a>
    <a href="#div3">to div3</a>
    <a id="div1Link">滑动到div1</a>
    <a id="div2Link">滑动到div2</a>
    <a id="div3Link">滑动到div3</a>
    </h2>
    <div id="div1">div1</div>
    <div id="div2">div2</div>
    <div id="div3">div3</div>
    <script type="text/javascript" src="jquery.min.js"></script>
    <script type="text/javascript">
    $("h2 a").click(function(){
    $(this).css('border-bottom','3px solid lime').siblings().css('border-bottom','0px solid red');
    })

    $(document).ready(function() {
    $("h2 #div1Link").click(function() {

    $("html, body").animate(
    {
    scrollTop: $("#div1").offset().top
    },
    {
    duration: 500,easing: "swing"
    });
    return false;
    });

    console.log($("#div1").offset().top);

    $("h2 #div2Link").click(function() {
    $("html, body").animate(
    {
    scrollTop: $("#div2").offset().top
    },
    {
    duration: 500,easing: "swing"
    });
    return false;
    });
    console.log($("#div2").offset().top);
    $("h2 #div3Link").click(function() {
    $("html, body").animate(
    {
    scrollTop: $("#div3").offset().top
    },
    {
    duration: 500,easing: "swing"
    });
    return false;
    });
    console.log($("#div3").offset().top);
    });

    </script>
    </body>
    </html>

  • 相关阅读:
    httprunner 3.x学习12
    httprunner 3.x学习11
    PyTorch中.view()与.reshape()方法以及.resize_()方法的对比
    算术编码简介
    量化参数QP:quantization parameter 以及 HEVC
    H.265/HEVC编码结构
    H.265 视频编码中的 CTU, CU, PU, TU
    I帧、P帧、B帧、GOP、IDR 和PTS, DTS之间的关系
    视频编码 率失真性能评价指标:PSNR SSIM BD-rate BD-PSNR
    矢量量化(VQ,Vector Quantization)
  • 原文地址:https://www.cnblogs.com/studyh5/p/7810659.html
Copyright © 2011-2022 走看看