Jquery: Catch height() or width() does not work with many elements

Asked

Viewed 242 times

1

I have a catalog that displays more than 400 products on the same page (it has to be like this) with two arrows showing the dimension (height and width) that takes the measurements of the image and applies an in-line CSS with the same values, so the arrows are the same size as the image. In Firefox all arrows take the measurements, but in Chrome, the last products (p. 64 and others below) get the small arrows, as if they didn’t take the values of the image. I associated it with loading and applied a setTimeout() but it didn’t work even changing the delay to 20000, 30000 or 0 whatever makes.

Url: http://noral.com.br/site/catalogo_noral

Code:

setTimeout(function(){jQuery(".catalogo .container main .pag .pag-cont-padrao .item .box img").html(function(){
    var get_id_img = $(this).attr("title");
    var get_height_img = $(this).height();
    var get_width_img = $(this).width();
    jQuery(".catalogo .pag .item .dim-ver #dim-ver-"+get_id_img).css({ "height": +get_height_img+"px" });
    jQuery(".catalogo .pag .item #dim-hor-"+get_id_img).css({ "width": +get_width_img+"px", "min-width":"20px" });
}, 0)});
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.