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>
  • 相关阅读:
    Part 11 Search filter in AngularJS
    Part 10 AngularJS sort rows by table header
    Part 9 Sorting data in AngularJS
    Part 8 AngularJS filters
    Part 7Handling events in AngularJS
    Part 6 AngularJS ng repeat directive
    PHP单一入口应用程序概述
    SVN
    跨平台的.NET集成开发环境:MonoDevelop
    PHP中使用KindEditor
  • 原文地址:https://www.cnblogs.com/mayufo/p/4349108.html
Copyright © 2011-2022 走看看