<script>
window.onload = function()
{
var oTxt = document.getElementById('txt1');
var oBtn = document.getElementById('btn1');
var oUl = document.getElementById('ul1'); oBtn.onclick = function()
{
// var aLi = oUl.getElementsByTagName('li'); // 补写:
var oLi=document.createElement('li');
// 先创建元素,再在后面用appendChild加给oUl // 赋值写反了! oTxt.innerHTML = oLi.value; // 前面用的是aLi,这里怎么表示单个li的值
oLi.innerHTML=oTxt.value;
oTxt.value=''; // if(aLi.length>0)
if(oUl.children.length>0)
{
// oUl.insertBefore(li, aLi[0])
oUl.insertBefore(oLi, oUl.children[0]);
}
else
{
// oUl.appendChild('li');
oUl.appendChild(oLi);
} var iHeight = oLi.offsetHeight; oLi.style.height='0'; // ??? startMove(oLi, {height: iHeight}, function (){
startMove(oLi, {opacity: 100});
// 调用的框架属性值用的json格式,所以这里要用花括号写。
}); // startMove(oLi, "height", iHeight, function()
// {
// startMove(oLi, "opacity", 100)
// },30); // 运动框架后面括号没有时间,定时器才有。
};
};
</script>

最新文章

  1. tinyXML的用法
  2. js如何判断一个数组
  3. 为什么没有选择sipml5
  4. js禁止复制页面文字
  5. Chrome扩展开发之三——Chrome扩展中的数据本地存储和下载
  6. Android:View中的performClick()触发条件
  7. 003--VS2013 C++ 多边形绘制
  8. iOS音效
  9. !! This tutorial was designed to help you with installation and configuration of OpenCV4Android SDK.
  10. 【JavaScript】JavaScript回调函数
  11. Redis中的关系查询(范围查询,模糊查询等...)
  12. caffe简易上手指南(一)—— 运行cifar例子
  13. Microsoft Windows Server 2008 R2 IIS7.5安装指南
  14. 将单链表的每K个节点之间逆序
  15. oracle中if/else
  16. js广告轮询效果
  17. 第十篇:Map/Reduce 工作机制分析 - 数据的流向分析
  18. Kali Linux Live USB初始化+使用日记
  19. leetcode日记 HouseRobber I II
  20. 51nod1236 序列求和 V3 【数学】

热门文章

  1. AI:OPENCV实现人脸的自动识别
  2. CSUOJ 1525 Algebraic Teamwork
  3. STM32的IO口的8种配置
  4. DataTable填充实体类返回泛型集合
  5. [Servlet]研究ServletContext对象
  6. SQl 行转列,列转行 (PIVOT,UPIVOT)
  7. powershell《语音报警系统》
  8. 认识Linux瘦客户机
  9. 【Codecraft-18 and Codeforces Round #458 (Div. 1 + Div. 2, combined) A】 Perfect Squares
  10. Android开源图表库XCL-Charts版本号公布及展示页