zoukankan      html  css  js  c++  java
  • 模拟微博发布

    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8">
    	<title>Document</title>
    	<style type="text/css">
    		*{margin:0;padding: 0;}
    		.one{ 400px;background: gray;margin: 10px auto}
    		input{ 300px;height: 30px;margin-top: 10px;}
    		textarea{ 300px;height: 80px;margin-top: 10px;}
    		label{vertical-align: top;margin-top: 10px;display: inline-block;}	
    		li{list-style: none;}
    		button{margin-left: 50px; 100px;height: 30px;}
    	</style>
    	<script src="js/jquery-1.7.1.min.js"></script>
    		<script type="text/javascript" src="js/jquery.easing.min.js"></script>
    </head>
    <body>
    	<div class="one">
    		<label>姓名:</label><input type="text"><br />
    		<label>内容:</label><textarea></textarea><br />
    		<button>发布</button>
    		<h1>留言表</h1>
    		<ul></ul>
    	</div>
    	<script type="text/javascript">
    		$(function(){
    			$("button").on("click",function(){
    				//创建元素
    				var labelObj = $("<li><p></p><p></p><a href=javascript:void(0)'>删除</a></li>");
    				labelObj.find("p").eq(0).text($("input").val());
    				labelObj.find("p").eq(1).text($("textarea").val());
    				$("input").val("");
    				$("textarea").val("");
    				$("ul").prepend(labelObj);
    				var h=labelObj.height();
    				labelObj.height(0);
    				labelObj.animate({
    					height:h,
    				})
    				labelObj.find("a").on("click",function(){
    					$(this).parent().animate({
    						height:0,
    					},function(){
    						$(this).remove();
    					})
    				})
    			})
    			
    		})
    	</script>
    </body>
    </html>
    

      

  • 相关阅读:
    JS的type类型为 text/template
    Vue之x-template(2)
    Vue之x-template(1)
    vue之$mount
    console.log()与console.dir()
    Less用法注意事项
    一次 Linux 系统被攻击的分析过程
    WebAR 如何改变增强现实的未来
    开发中的测试名词解释
    Flutter 同步系统的 HTTP 代理设置
  • 原文地址:https://www.cnblogs.com/ldlx-mars/p/6930335.html
Copyright © 2011-2022 走看看