jQuery get total height


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $.fn.totalHeight = function() {
  2. var total = 0;
  3. this.each(function(i, el) {
  4. total += $(el).height();
  5. });
  6. return total;
  7. };
  8. $.fn.totalOuterHeight = function() {
  9. var total = 0;
  10. this.each(function(i, el) {
  11. total += $(el).outerHeight();
  12. });
  13. return total;
  14. };

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.