Tuesday, November 8, 2011

jQuery get total height

[javascript]
$.fn.totalHeight = function() {
var total = 0;
this.each(function(i, el) {
total += $(el).height();
});
return total;
};
$.fn.totalOuterHeight = function() {
var total = 0;
this.each(function(i, el) {
total += $(el).outerHeight();
});
return total;
};
[/javascript]

0 comments:

Post a Comment