Jump to content

Make Product List Columns same Height


Recommended Posts

If you go to this page,

 

https://www.janetscloset.com/index.php?id_category=359&controller=category&p=2

 

You will see that the three product columns at the top are mismatched. The middle is longer than the others, how would I get it to display so they're all even? Like maybe have a set height?

 

Or be dynamic and go off the longest one for that row?

Link to comment
Share on other sites

you can use this js script:
 

$(document).ready(function(){
$.fn.setAllToMaxHeight = function(){
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) );
}
$('#product_list li').setAllToMaxHeight();
});
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...

 

you can use this js script:

 

$(document).ready(function(){
$.fn.setAllToMaxHeight = function(){
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) );
}
$('#product_list li').setAllToMaxHeight();
});

That´s exactly what I was looking for. But I have one little question:

Where exactly do I have to put the code in?

Edited by SebastianS. (see edit history)
Link to comment
Share on other sites

Bevor I tried to get the product container to the same height, i removed the hover effect and the add to cart button like told

 

here

https://www.prestashop.com/forums/topic/328820-removing-ajax-hover/?p=1664611

 

here

https://www.prestashop.com/forums/topic/341852-solved-remove-the-black-contenair-price-when-hover-the-grid-list-product/?p=1724145

 

and here

https://www.prestashop.com/forums/topic/341852-solved-remove-the-black-contenair-price-when-hover-the-grid-list-product/?p=1724797

 

So I only got the "Border-Hover-Effect" left.

 

Is it possible that these changes are causing the problem with the equal heights?

Link to comment
Share on other sites

Unfortunately I´m on local. What I have done now is change product_list.css to:

ul.product_list.grid > li .product-container {
    background: white;
    padding: 0;
    position: relative;
	height: 300px; }
@media (min-width: 480px) and (max-width: 767px)	{
	ul.product_list.grid > li .product-container {
	height:auto;[spam-filter]

Could this cause any problems?

I inserted media queries to keep the responsive functionality.

Edited by SebastianS. (see edit history)
Link to comment
Share on other sites

  • 5 years later...
On 1/5/2015 at 11:10 PM, vekia said:

you can use this js script:
 


$(document).ready(function(){
$.fn.setAllToMaxHeight = function(){
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) );
}
$('#product_list li').setAllToMaxHeight();
});

THANKS ! REALLY !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...