美文网首页
文字搬运工

文字搬运工

作者: 李哈哈_bing | 来源:发表于2018-02-23 20:18 被阅读0次
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="../idea/widows.css" rel="stylesheet">
    <style>
        body {
            background-color: #C6C6C6;
        }

        .outs {
            width: 840px;
            height: 280px;
            background-color: #FFFFFF;
            border-radius: 12px;
            margin: 50px auto;
        }

        #write{
            width: 338px;
            height: 240px;
            background-color: #EFEFD6;
            float: left;
            margin-top: 20px;
            margin-left: 18px;
        }

        .inof {
            float: left;
            margin-top: 20px;
            margin-left: 6px;
        }

        .inof a {
            color: white;
            font-size: 18px;
        }

        .inof .lock {
            width: 110px;
            height: 42px;
            line-height: 42px;
            text-align: center;
            background-color: #F76300;
        }

        .inof .num {
            /*background-color: #73A500;*/
            text-align: center;
            margin-top: 30px;
        }

        .inof .num p {
            color: black;
            font-size: 26px;
            font-weight: bold;
        }

        .last {
            width: 338px;
            height: 240px;
            background-color: #63EFF7;
            float: right;
            margin-top: 20px;
            margin-right: 18px;
        }
    </style>
    <script>
        window, onload = function () {
            var time = 0;
            var text = document.getElementById('write');
            var opens = document.getElementById('open');
            var blocks = document.getElementById('block');
            var spans = document.getElementById('span1');
            var spanes = document.getElementById('span2');
            opens.onclick = function () {
                var str = text.value;
                var arr = str.split('');
                var array=str.split('');
                var index = 0;

                if (arr.length == 0) {
                    alert("请在左侧输入文字");
                    blocks.innerHTML ='';
                    return;
                }
                time = setInterval(function () {
                    text.value=array.join('');
                    array.shift();
                    if (index == arr.length) {
                        clearInterval(time);
                        return;
                    }
                    var num = index;
                    blocks.innerHTML += arr[index];
                    spanes.innerHTML = arr.length;
                    spans.innerHTML = num + 1;
                    index++;
                }, 200)

                blocks.innerHTML ='';
            }
        }
    </script>
</head>
<body>
<div class="outs">

    <textarea id="write"></textarea>
    <div class="inof">
        <div class="lock"><a href="#" id="open">把文字右移</a></div>
        <div class="num"><p><span id="span1">0</span>/<span id="span2">0</span></p></div>
    </div>
    <div class="last" id="block"></div>
</div>

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

相关文章

  • 文字,文章

    我我不生产文字,我们只是文字的搬运工。

  • 文字搬运工

  • 文字搬运工

  • 文字搬运工

  • 文字搬运工

    我记得你爱我,或许是我记反了。 想念有个别名,叫自捅千刀。 《李宫俊的诗》 韩寒说:“我们听过无数的道理,却仍旧过...

  • 文字搬运工

    简书的主题是创作。 我的文字功底很差,写作的内容大部分就是参照、借鉴、模仿、其实也可以说是抄袭,但文字的魅力很大,...

  • 文字搬运工

    讲起搬运工,每个人都知道,泛指是把某种重而多的货物,根据货主的要求,通过繁重而比较复朵的过程,耗用很大的时间...

  • 今日晴,不算冷

    最近两天更新的感受就是:做个文字搬运工比编辑文字容易多了,所谓的文字搬运工是从看过的文章里挑些自己喜欢的一段文...

  • 媒体

    我们不是文字的生产者 我们只是广告的搬运工

  • 文字搬运工———理想

    我的理想是什么? 从我记事起,或者从我明白理想是什么的时候,我都是渴望自己很有钱,有花不完的钱! 上学,不知道自己...

网友评论

      本文标题:文字搬运工

      本文链接:https://www.haomeiwen.com/subject/gmnxxftx.html