随笔分类 - 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++){
阅读全文
摘要:1 //通过类名获取元素 2 function getByClass(oParent,sClass){ 3 //高版本浏览器使用系统自带方法 4 if(oParent.getElementsByClassName){ 5 return oParent.getElementsByClassName(s
阅读全文
摘要:1 function getByClass(obj,sClass){ 2 if(obj.getElementsByClassName){ 3 return obj.getElementsByClassName(sClass); 4 }else{ 5 var arr=[]; 6 //var reg=/
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:function getStyle(obj,name){ return (obj.currentStyle || getComputedStyle(obj,false))[name]; } function move(obj,json,options){ options=options || {};
阅读全文
摘要: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...
阅读全文

浙公网安备 33010602011771号