• js运动 运动效果留言本


    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>无标题文档</title>
    <style>
    #ul1 { margin: 0; position: absolute; right: 10px; top: 8px;  700px; height: 500px; border: 1px solid #000; padding: 10px; overflow: hidden;}
    li { line-height: 28px; border-bottom: 1px dotted #000; list-style: none; word-break: break-all; overflow: hidden;}
    </style>
    <script src="move.js"></script>
    <script>
    /*
    先写出没有运动的效果,然后把赋值变成运动形式
    */
    window.onload = function() {
        
        var oContent = document.getElementById('content');
        var oBtn = document.getElementById('btn');
        var oUl = document.getElementById('ul1');
        
        oBtn.onclick = function() {
            
            var oLi = document.createElement('li');
            oLi.innerHTML = oContent.value;
            
            if ( oUl.children[0] ) {
                oUl.insertBefore( oLi, oUl.children[0] );
            } else {
                oUl.appendChild( oLi );
            }
            
            //var iHeight = oLi.offsetHeight;
            var iHeight = parseInt( css(oLi, 'height') );
            
            oLi.style.height = '0px';
            oLi.style.opacity = '0';
            oLi.style.filter = 'alpha(opacity=0)';
            
            startMove(oLi, {
                height : iHeight,
                opacity : 100
            });
            
        }
        
    }
    </script>
    </head>
    
    <body>
        <textarea id="content" rows="10" cols="50"></textarea>
        <input type="button" value="留言" id="btn" />
        <ul id="ul1"></ul>
    </body>
    </html>
  • 相关阅读:
    2016.7.22.noip2012D2
    2016.7.21.noip2014D2
    LIS最长上升子序列O(n^2)与O(nlogn)的算法
    vijos1910解方程
    vijos1909寻找道路
    viojs1908无线网路发射器选址
    P1907飞扬的小鸟
    P1906联合权值
    P1905生活大爆炸版 石头剪刀布
    poj1274(匈牙利算法)
  • 原文地址:https://www.cnblogs.com/mayufo/p/4349108.html
Copyright © 2020-2023  润新知