Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code #20

Open
RachelRen opened this issue Sep 12, 2018 · 0 comments
Open

code #20

RachelRen opened this issue Sep 12, 2018 · 0 comments

Comments

@RachelRen
Copy link
Owner

RachelRen commented Sep 12, 2018

<!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,maximum-scale=1,user-scalable=no">
    <meta name="format-detection" content="telephone=no"> <!-- 禁止自动识别电话号码 -->
    <meta name="format-detection" content="email=no"> <!-- 禁止自动识别邮箱 -->
    <meta name="keywords" content="DAHR" />
    <meta name="description" content="DAHR" />
    <title>性能</title>
    <style>


    </style>

</head>

<body>
    <button id="grow">grow</button>
    <div>
        <button id="create">create</button>
    </div>
    <div>
        <button id="newGrow">newGrow</button>
    </div>


    <script type="text/javascript">
        var x = [];

        function grow() {
          for (var i = 0; i < 10000; i++) {
            document.body.appendChild(document.createElement('div'));
          }
          x.push(new Array(1000000).join('x'));
        }

        document.getElementById('grow').addEventListener('click', grow);


        var detachedTreedetachedNodes;

        function create() {
          var ul = document.createElement('ul');
          for (var i = 0; i < 10; i++) {
            var li = document.createElement('li');
            ul.appendChild(li);
          }
          detachedTreedetachedNodes = ul;
        }

        document.getElementById('create').addEventListener('click', create);


        var newx = [];

        function newGrow() {
          newx.push(new Array(1000000).join('x'));
          newx.push([10])
          newx.push([10])
          newx.push([10])
        }

        document.getElementById('newGrow').addEventListener('click', newGrow);
    </script>
</body>
</html>



<!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,maximum-scale=1,user-scalable=no">
    <meta name="format-detection" content="telephone=no"> <!-- 禁止自动识别电话号码 -->
    <meta name="format-detection" content="email=no"> <!-- 禁止自动识别邮箱 -->
    <meta name="keywords" content="DAHR" />
    <meta name="description" content="DAHR" />
    <title>渲染</title>
    <style>
        .div {
            width: 100px;
            height: 100px;
            background: #f00;

        }

        #react {
            position: relative;
            top: 300;
            width: 100px;
            height: 100px;
            background-color: red;
        }

        .div1 {
            transform: translateY(0);
            width: 100px;
            height: 100px;
            background-color: red;
        }

        .buttons {
            position: absolute;
            right: 0;
            top: 0;
        }

    </style>

</head>

<body>
    <div class="div" id="div"></div>
    <div class="div" id="div1"></div>
    <div class="div1" id="div2"></div>
    <div id="react"></div>
    <div class="buttons">
        <div>
            <button onclick="test()">test1</button>

        </div>
        <div>
            <button onclick="test2()">test2</button>

        </div>
        <div>
            <button onclick="test3()">test3</button>

        </div>
    </div>

    <script type="text/javascript">
        function test(){
            document.getElementById("div").style.opacity = "0"
        }
        function test2(){
            document.getElementById("div1").style.visibility = "hidden"
        }

        function test3(){
            document.getElementById("div2").style.transform = "translateY(100px)" 
        }



        setTimeout(() => {
            document.getElementById("react").style.top = "500px"
        }, 2000);
    </script>
</body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant