Javascript recipes
Last updated
Was this helpful?
Last updated
Was this helpful?
getComputedStyle is a function attach to window object. It allows to get the exact same information than the chrome computed properties So the list of all properties of a given element
getComputedStyle($('body'))
To extract only the info you need you can take advantage of ES6 syntax
So here we got for example order: 0 and height: 25078.3px
To extract only the numerical value of the pixel and drop the .3 You can use
The result is 25078
The original