缩放和滚动dom元素

缩放和滚动dom元素

效果视频:

屏幕录制2022-08-23 20.30.16

html部分代码,主要是css和父子dom


<!DOCTYPE html>
<html lang="en">
  <head>
    <Meta charset="UTF-8" />
    <Meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <Meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        margin: 0;
        Box-sizing: border-Box;
      }
      .parent {
        position: relative;
        margin: auto;
        top: 50vh;
        transform: translateY(-50%);
        background-color: rgba(26, 34, 39, 0.315);
        width: 70vw;
        height: 70vh;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .child {
        width: 60%;
        height: 50%;
        background-color: rgba(0, 122, 204);
        display: block;
        position: relative;
      }
    </style>
  </head>
  <body>
    <div class="parent">
      <div class="child"></div>
    </div>

    <script type="module">
      // import { SelectAnimation } from './select-translate.js';
      // console.log(SelectAnimation);
      // SelectAnimation.setDom(document.querySelector('.parent'));
      // SelectAnimation.clickMouseMove(document.querySelector('.child'))
      import { ScaleMoveDom } from './scaleMoveDom.js';

      const params = {
        parentDom: document.querySelector('.parent'),
        childrenDom: document.querySelector('.child')
      }
      console.log('
                

相关文章

显卡天梯图2024最新版,显卡是电脑进行图形处理的重要设备,...
初始化电脑时出现问题怎么办,可以使用win系统的安装介质,连...
todesk远程开机怎么设置,两台电脑要在同一局域网内,然后需...
油猴谷歌插件怎么安装,可以通过谷歌应用商店进行安装,需要...
虚拟内存这个名词想必很多人都听说过,我们在使用电脑的时候...