标签:turn else com false css compute 方法 func 用法
// jQuery的CSS()方法,其底层运作就应用了getComputedStyle以及getPropertyValue方法。
// getComputedStyle方法是只读的
// element.style能读能写
// getAttribute方法提供了与getPropertyValue方法类似的功能,可以访问CSS样式对象的属性。用法与getPropertyValue类似
// 返回 px,rgb
// 返回 em #fff
function getStyle(obj,attr,value){ // value // obj.(attr) if(value){obj.style[attr]=value} else{ if(obj.currentStyle){ return obj.currentStyle(attr) }else{ obj.getComputedStyle(attr,false) } } };
标签:turn else com false css compute 方法 func 用法
原文地址:http://www.cnblogs.com/alan-alan/p/7462647.html