Advertisement
SalahAdDinYusuf

Altura dinámica de Divs

Sep 17th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(window).on('load',function(){
  2.     var childHeight = [];
  3.     if($(window).width() > 640) {
  4.         $('.news-gallery').find('article').each(function() {
  5.             childHeight.push($(this).outerHeight());
  6.             console.log(childHeight);
  7.             newChildHeight = Math.max.apply(Math, childHeight);
  8.             $('article').css('height', parseInt(newChildHeight)+'px');
  9.         });
  10.     }
  11.     else{
  12.         $('.news-gallery').attr('style', ' '); }
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement