February 23, 201412 yr HI Guys, After a bit of help here I have solved a similar issue on the site before but just cannot work this one out. The website is: http://madelovinglymade.com/ When you view the site on a mobile phone or shrink it to about 300px wide on a desktop the products at the bottom (Recent Products) some of there appear not inline. I.e. you have 2 per row but some only display 1 product per row. When I had the similar issue before it was fixed by amending the line height. However I am just lost with this one and cannot solve it as of yet. Thanks for the help.
February 23, 201412 yr I'm not sure what the solution is although I think I have come across the same thing before so I'll see if I can remember whether I solved it. The problem is that some of your lines of description are longer than others and overflow onto 2 lines, which makes the box taller - you probably knew that
February 23, 201412 yr OK, I think what I did was give the captions a fixed height which is probably not a very elegant solution. {display: block; height: 50px;} Edited February 23, 201412 yr by Jane B
February 23, 201412 yr A possible jQuery solution will be to get the height of the tallest element in the row and assign the same height to the other elements, so they all have equal heights; jQuery(document).ready( function($){ $.fn.equalHeights = function() { var maxHeight = 0; return this.each(function(index, box) { var boxHeight = $(box).height(); maxHeight = Math.max(maxHeight, boxHeight); }).height(maxHeight); }; $('your-class-here').equalHeights(); }); Then on widow resize you need to make sure they keep the same height: jQuery( window ).resize(function() { $('your-class-here').equalHeights(); $('your-class-here').css('height', 'auto'); }); Hope that helps
February 23, 201412 yr Author Thanks for the help. I have gone for the quick and dirty solution so far of setting a fixed height of 260px. Will looking into ti further when I have more time. Thanks Again.
Create an account or sign in to comment