¡@

Home 

2014/10/16 ¤W¤È 12:02:19

jquery Programming Glossary: camelize

jQuery CSS plugin that returns computed style of element to pseudo clone that element?

http://stackoverflow.com/questions/1004475/jquery-css-plugin-that-returns-computed-style-of-element-to-pseudo-clone-that-el

function .fn.getStyleObject function var dom this.get 0 var style var returns if window.getComputedStyle var camelize function a b return b.toUpperCase style window.getComputedStyle dom null for var i 0 i style.length i var prop style.. style window.getComputedStyle dom null for var i 0 i style.length i var prop style i var camel prop.replace a z g camelize var val style.getPropertyValue prop returns camel val return returns if dom.currentStyle style dom.currentStyle for..

Get computed font size for DOM element in JS

http://stackoverflow.com/questions/1955048/get-computed-font-size-for-dom-element-in-js

you can look for the DOM Level 2 standard getComputedStyle method if available function getStyle el styleProp var camelize function str return str.replace w g function str letter return letter.toUpperCase if el.currentStyle return el.currentStyle.. str return str.replace w g function str letter return letter.toUpperCase if el.currentStyle return el.currentStyle camelize styleProp else if document.defaultView document.defaultView.getComputedStyle return document.defaultView.getComputedStyle.. return document.defaultView.getComputedStyle el null .getPropertyValue styleProp else return el.style camelize styleProp Usage var element document.getElementById 'elementId' getStyle element 'font size' More info Get Styles QuirksMode..