<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>右下角悬浮框案列</title>
  <style>
    body{
      height: 2000px;
    }
    #div1{
      width: 200px;
      height: 150px;
      background: red;
      position: absolute;
      right: 0;
      bottom: 0;

    }
  </style>
  <script>
    window.onscroll  =function () {
      var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
      console.log(scrollTop)

      var oDiv =document.getElementById('div1');

      //oDiv.offsetHeight 获取div的高度
      oDiv.style.top = document.documentElement.clientHeight - oDiv.offsetHeight +scrollTop +'px'
    }
  </script>

</head>
<body>

<div >

</div>
</body>
</html>

 分析图:

右下角悬浮框案列

效果图:

右下角悬浮框案列

 

相关文章:

  • 2021-07-07
  • 2021-12-05
  • 2021-11-24
  • 2021-07-16
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
猜你喜欢
  • 2021-06-24
  • 2022-01-10
  • 2022-12-23
  • 2021-12-19
  • 2022-01-10
  • 2022-12-23
  • 2021-06-08
相关资源
相似解决方案