VUE-多元素垂直排列,有一列自動填充

shenzhen_zsw發表於2018-07-21

效果圖

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
      html,body{
        width: 100%;
        height: 100%;
        margin: 0px;
        padding: 0px;
      }

      .outer {
        width: 100%;
        height: 100%;
        background: #dcdfe6;
        padding-top: 200px;
        box-sizing: border-box;
        position: relative;
      }

      .search {
        height: 100px;
        background: #5daf34;
        position: absolute; top: 0 ; left: 0 ; width: 100%;
      }

      .funtools {
        height: 100px;
        background: #3a8ee6;
        position: absolute; top: 100px ; left: 0 ; width: 100%;
      }

      .gridPanle {
        height: 100%;
        background: #4efffb;
      }
    </style>

  <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
    function hideSearch(){
      $('#search').hide();
      $('#funtools').css("top",0);
      $('.outer').css("padding-top", "100px");
    }

    function showSearch(){
      $('#search').show();
      $('#funtools').css("top",'100px');
      $('.outer').css("padding-top", "200px");
    }
</script>

</head>
<body>
<div class="outer">
  <div id="search" class="search">
    search
  </div>
  <div id="funtools" class="funtools">
    funtools
    <input type="button" value="隱藏查詢欄" onclick="hideSearch()">
    <input type="button" value="顯示查詢欄" onclick="showSearch()">
  </div>
  <div id="gridPanle" class="gridPanle">
    grid
  </div>
</div>
</body>
</html>

 

相關文章