简单微博效果

<style>
*{margin:0;padding:0;}
body{text-align:center;background:#000000;color:#FFFFFF;}
h1{margin:30px;font-weight:bold;}
hr{margin:20px;}
#Btn{width:100px;height:40px;margin-top:10px;}
#Ul{border:1px solid #FFFF00;width:300px;height:350px;background:#CCCCCC;margin:20px auto;overflow:hidden;}
#Ul li{border-bottom:1px solid #00FF00;list-style:none;text-align:left;color:#FF0000;}
</style>

<script>

/*
insertBefore()----------------在您指定的已有子节点之前插入新的子节点
appendChild()----------------方法向节点添加最后一个子节点,即是添加到最后
*/
window.onload=function()
{
var oUl=document.getElementById(‘Ul‘);
var oBtn=document.getElementById(‘Btn‘);
var oTxt=document.getElementById(‘Txt‘);

oBtn.onclick=function()
{
var oLi=document.createElement(‘li‘);
oLi.innerHTML=oTxt.value;
oTxt.value=‘‘;

if(oUl.children.length>0)
{
//在您指定的已有子节点之前插入新的子节点
oUl.insertBefore(oLi, oUl.children[0]);
}
else
{
//方法向节点添加最后一个子节点,即是添加到最后
oUl.appendChild(oLi);
}
}
}
</script>
</head>

<body>
<h1>微博效果</h1>
<hr />
<textarea id="Txt" cols="40" rows="3"></textarea>
<br />
<input id="Btn" type="button" value="发送"/>
<ul id="Ul">

</ul>
</body>

时间: 2024-08-12 18:30:29

简单微博效果的相关文章

iOS UI基础-9.2 UITableView 简单微博列表

概述 我们要实现的效果: 这个界面布局也是UITableView实现的,其中的内容就是UITableViewCell,只是这个UITableViewCell是用户自定义实现的.虽然系统自带的UITableViewCell已经够强大了,但是这个界面布局并不能满足我们的需求. 在上面的cell布局里,我们可以知道,每个cell的高度都是不固定的.因此,我们通过代码来自定义cell. 代码自定义cell 步骤: 1.新建一个继承自UITableViewCell的类 2.重写initWithStyle:

完美拖拽 &amp;&amp;仿腾讯微博效果&amp;&amp; 自定义多级右键菜单

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-

iOS开发——实用技术OC篇&amp;简单抽屉效果的实现

简单抽屉效果的实现 就目前大部分App来说基本上都有关于抽屉效果的实现,比如QQ/微信等.所以,今天我们就来简单的实现一下.当然如果你想你的效果更好或者是封装成一个到哪里都能用的工具类,那就还需要下一些功夫了,我们这里知识简单的介绍怎么去实现,不过一般我们开发都是找别人做好的,也没必要烂肺时间,除非你真的是大牛或者闲的蛋疼. 其实关于抽屉效果就是界面有三个View,其实一个主View其他两个分别是左边和右边的View,我们分别为他们添加手势,实现左右滑动显示对应的View. 一:所以,首先我们需

自定义实现ExpandableListView收缩的简单动画效果

以下是 ExpandableListView 收缩的简单动画效果 1 /* 2 * Copyright (C) 2014 Gary Guo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the L

js网站轮播图怎么做如何做?鸡哥教你简单制作效果炫酷

日了狗啦,刚刚鸡哥辛苦码了那么多字全丢了又要重新写,这是第二遍写了...今天鸡哥给小白写个不需要写js原生代码,只需要几个插件和一段通俗易懂得jquery代码就能搞定的轮播图,当然js原生代码写着也不算很繁琐,但是有些浪费时间,更何况很多人并不会用js直接写包括鸡哥,当年在学校还是研究过一段时间js的,当时还独自写了一个轮播图俘获了多少同班妹子的芳心,不过现在是基本废了,这东西要常写,不然忘的很快. 唉,本来还有妹子等着鸡哥呢,我这一大意文章丢了,重新写的话估计来不及了,先打个电话让妹子回家吧~

Js仿腾讯微博效果,无刷新删除微博

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-

JavaScript简单计算器效果

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>简单计算器效果</title> </head> <body> <form name="myForm"> 数字1:<input type="text" name="nu

HTML与CSS简单页面效果实例

本篇博客实现一个HTML与CSS简单页面效果实例 index.html 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Insert title here</title> 6 <link href="style.css" rel="stylesheet" type="t

基于定时器延时器的简单打字效果——拿去表白吧

1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title></title> 6 7 <style> 8 #div1{ 9 width: 300px; height: 500px; margin: 0 auto;border: 10px solid skyblue; border-radius: 10px; 10 line-