Hey guys. I’m using masonry grid for a blog content. How I will change the height of the grid if the screen is change? Tbh. I don’t even know the calculations. For example; assume that I choose the Nexus 4 on device toolbar the element of grid will be like this;
<div class="grid" style="position: relative; height: 2304px;">
If I choose Nexus 5;
<div class="grid" style="position: relative; height: 2160px;">
Current:
<div class="grid" style="position: relative; height: 1011.75px;">
JavaScript:
$(window).resize(function() {
var gridheight = $('.grid').height() * 4;
$(".grid").height(gridheight);
}).resize();