I'm facing a problem with the jquery .css
function. I am using it to retrieve the actual height of elements that have their height set to auto. The code I am currently using is as follows:
$(this).css({ height: $(this).css("height"), width: $(this).css("width") });
The issue arises when the .css
function sometimes returns "0px"
, sometimes "auto"
, and other times the actual height (which is the expected behavior). Can someone please point out what I might be doing incorrectly in this case?