zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    省选模拟64
    省选模拟63
    杂题
    省选模拟62
    省选模拟61
    省选模拟60
    省选模拟58
    IntelliJ IDEA配置tomcat【全程详解】
    java之 Timer 类的简单使用案例
    Intellij IDEA导入Github中的MAVEN多模块项目【保持项目样式】
  • 原文地址:https://www.cnblogs.com/mayufo/p/4349108.html
Copyright © 2011-2022 走看看