You can implement this very simple jQuery plugin:
Plugin Definition:
(function($) {
$.fn.cssValue = function(p) {
var result;
return isNaN(result = parseFloat(this.css(p))) ? 0 : result;
};
})(jQuery);
It is resistant to NaN
values that may occur in old IE version (will return 0
instead)
Usage:
$(this).cssValue('marginBottom');
Enjoy! :)