摘要: -webkit /*Chrome/Safari*/-moz /*Firefox*/-ms /*IE*/-o /*Opera*/ 阅读全文
posted @ 2013-04-24 16:44 殇灬绝恋 阅读(86) 评论(0) 推荐(0) 编辑
摘要: setInterval周期 clearInterval 关闭无缝滚动<style>ul{ list-style:none;}*{padding:0;margin:0;}#div1{position:relative;width:700px;height:200px;margin:100px auto;border:1px solid red;}#div1 ul{position:absolute;left:0;top:0;}#div1 ul li{width:200px;height:100px;border:1px solid red;float:left;}</style 阅读全文
posted @ 2013-04-19 13:39 殇灬绝恋 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 创建DOM元素createElement(标签名)创建一个节点appendChild(节点)追加一个节点例子:为ul插入liwindow.onload=function(){ var oBtn=document.getElementById('btn1'); var oUl=document.getElementById('ul1'); oBtn.onclick=function () { var oLi=document.createElement('li'); //父.appendChild(子节点) ... 阅读全文
posted @ 2013-04-18 16:07 殇灬绝恋 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 父节点(只有一个)子节点(只能一层)childNodes 子节点<script>window.onload=function(){ var oUl=document.getElementById('ul1'); oUl.childNodes[0].style.background='red';}</script><ul id="ul1"> <li>11111</li> <li>22222</li> <li>33333</li> < 阅读全文
posted @ 2013-04-15 14:43 殇灬绝恋 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 1/数组使用例子:var arr=[1,2,3,4];var arr=new Array(1,2,3,4);2/数组的属性length--既可以快速获取,又可以设置--例子:快速清空数组var arr=[1,2,3,4];arr.length=10;alert(arr[6]);3/数组的添加、删除 添加 -push(元素),从尾部添加 -unshift(元素),从头部添加删除 -pop(),从尾部删除 -shift(),从头部删除4/数组的排序sort()var attr=[96,30,83,73,100];attr.sort(function (num1,num2){ retu... 阅读全文
posted @ 2013-04-12 15:38 殇灬绝恋 阅读(118) 评论(1) 推荐(0) 编辑
摘要: return 函数返回值例子:function show(a,b){ return(a+b)}alert(show(6,7))arguments 参数数组 (可变参,不定参)function sum(){ var result=0; var i=0; for(i=0;i<arguments.length;i++) { result+=arguments[i]; } alert(result);}sum(12, 5, 7, 8, 12, 5, 7, 8, 12, 5, 7, 8, 12, 5, 7, 8, 12, 5, 7, 8,... 阅读全文
posted @ 2013-04-12 10:47 殇灬绝恋 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 常见的浏览器下margin出现的bug林总总写了那么多,最后总结一些浏览器中常见的margin Bug吧,以后遇到margin下的布局问题可以查看这里找到解决的方案,如果你还发现其他关于浏览器下margin的Bug你可以发表留言,核对采纳后我会及时添加进去,感谢你的分享:IE6中双边距Bug:发生场合:当给父元素内第一个浮动元素设置margin-left(元素float:left)或margin-right(元素float:right)时margin加倍。解决方法:是给浮动元素加上display:inline;CSS属性;或者用padding-left代替margin-left。原理分析:块级 阅读全文
posted @ 2013-04-10 13:39 殇灬绝恋 阅读(311) 评论(0) 推荐(0) 编辑
摘要: http://www.blueidea.com/tech/web/2011/8485.asp 蓝色理想原文 阅读全文
posted @ 2013-04-10 11:33 殇灬绝恋 阅读(99) 评论(0) 推荐(0) 编辑
摘要: switch使用default: ......;break、continue 阅读全文
posted @ 2013-04-09 11:47 殇灬绝恋 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 运算符 算术:+ 加、- 减、* 乘、/ 除、% 取模 实例:隔行变色、秒转时间 赋值:=、+=、-=、*=、/=、%= 关系:<、>、<=、>=、==、===、!=、!== 逻辑:&& 与、|| 或、! 否 实例:全选与反选 运算符优先级:括号 阅读全文
posted @ 2013-04-09 10:49 殇灬绝恋 阅读(134) 评论(0) 推荐(0) 编辑