随笔分类 -  JavaScript

摘要:1 function clone(obj) 2 { 3 if(typeof obj!='object'){ 4 return obj; 5 } 6 7 if(obj instanceof Array){ 8 var arr=[]; 9 for(var i=0; i<obj.length; i++){ 阅读全文
posted @ 2016-02-10 22:58 agosto 阅读(822) 评论(0) 推荐(0)
摘要:1 //通过类名获取元素 2 function getByClass(oParent,sClass){ 3 //高版本浏览器使用系统自带方法 4 if(oParent.getElementsByClassName){ 5 return oParent.getElementsByClassName(s 阅读全文
posted @ 2016-02-10 22:31 agosto 阅读(486) 评论(0) 推荐(0)
摘要:1 function getByClass(obj,sClass){ 2 if(obj.getElementsByClassName){ 3 return obj.getElementsByClassName(sClass); 4 }else{ 5 var arr=[]; 6 //var reg=/ 阅读全文
posted @ 2016-02-01 12:42 agosto 阅读(210) 评论(0) 推荐(0)
摘要:1 select.css 2 3 *{padding:0;margin:0;} 4 .box{position: relative;width: 100px;} 5 ul,li{list-style: none;background: #eee;} 6 .box span{display:blo... 阅读全文
posted @ 2015-12-18 20:08 agosto 阅读(150) 评论(0) 推荐(0)
摘要:1 checkbox.css 2 3 *{padding: 0;margin:0;} 4 span{background: url(images/no.gif) no-repeat;padding-left: 20px;} 5 .active{background: url(images/yes... 阅读全文
posted @ 2015-12-18 20:04 agosto 阅读(279) 评论(0) 推荐(0)
摘要:function getStyle(obj,name){ return (obj.currentStyle || getComputedStyle(obj,false))[name]; } function move(obj,json,options){ options=options || {}; 阅读全文
posted @ 2015-12-18 19:59 agosto 阅读(167) 评论(0) 推荐(0)
摘要:myRadio .css*{padding: 0;margin:0;}span{background: url(images/no.gif) no-repeat;padding-left: 20px;}.active{background: url(images/yes.gif) no-repeat... 阅读全文
posted @ 2015-12-18 19:58 agosto 阅读(190) 评论(0) 推荐(0)
摘要:JS操作属性 阅读全文
posted @ 2015-12-07 23:36 agosto 阅读(155) 评论(0) 推荐(0)
摘要:选项卡的重用 阅读全文
posted @ 2015-12-07 22:55 agosto 阅读(386) 评论(0) 推荐(0)