JSFiddle - React, Tailwind, and code Playground

by ruirui

HTML

<div class="frame-wrapper">
  <div class="frame-header"></div>
  <div class="frame-page">
    <!--这是页面内容-->
    <div class="page moved" id="test">
      <div class="page-inner">

      </div>
    </div>
  </div>

</div>

CSS

.frame-wrapper {
    position: absolute;
    height: 500px;
    width: 500px;
    display: flex;
  }
  .frame-wrapper .frame-page {
    flex-grow: 1;
  }
  .page {
    background-color: red;
    height: 300px;
    /* position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0; */

  }
  .page-inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 20px;
    bottom: 0;
    background-color: yellow;
  }
  .moved {
    transform: translateX(10px);
  }

JavaScript

setTimeout(function() {
    $('#test').removeClass('moved');
  }, 1500);