Explanation
I cannot believe this has not been asked before but anyway... Please do not get confused with this question.
I am trying to store the height of an element using the jQuery data
method so that I can retrieve this value and reset the original value on a specific element.
However, when I try to get the height of my element, it returns the computed height and not the actual CSS value. Whilst this is extremely helpful in other cases, I actually need to get the exact value specified in my stylesheet whether it be 100%, auto, 10px etc...
My Question
Is there a way to get the exact CSS (non-computed) value of an element using jQuery?
For example (CSS):
#wrapper {
height: auto;
}
And JS:
// Returns 'auto' NOT computed value...
var height = $('#wrapper').height();
Further Information
The only alternative I can currently see is just removing the inline style
tag on my element which will remove any styles applied by jQuery. The obviously flaw in this method is that it will remove all styles not just one in particular...