首页 > 代码库 > javascript 微博发布框

javascript 微博发布框

发布后的内容高度缓慢变大,透明度从0到100

js代码:

<script>
window.onload=function(){
<span style="white-space:pre">	</span>var oTxt=document.getElementById('txts');
<span style="white-space:pre">	</span>var oBtn=document.getElementById('btn');
<span style="white-space:pre">	</span>var oUl=document.getElementById('ul1');
<span style="white-space:pre">	</span>var oLi=oUl.getElementsByTagName('li');
	oBtn.onclick=function(){
	<span style="white-space:pre">	</span>var node=document.createElement('li');
		node.innerHTML=oTxt.value;
		oTxt.value=http://www.mamicode.com/'';>
};
</script>

html代码如下:

<style>
		
#ul1{
	width:400px;
	height:400px;
	margin:10px auto;
	padding:0px;
	border:1px solid #222222;
	overflow:hidden;
}
#ul1 li{
	width:360px;
	margin:0px auto;
	padding:4px;
	border-bottom:1px dashed #222222;
	list-style:none;	
	overflow:hidden;
	filter:alpha(opacity=0);
	opacity: 0;
	text-overflow: ellipsis;
}
</style>


<body>
<span style="white-space:pre">	</span><textarea id="txts" cols="40" rows="4" style="resize: none"></textarea>
	<input id="btn" type="button" value=http://www.mamicode.com/"发布" />>

javascript 微博发布框