Answer the question
In order to leave comments, you need to log in
How to add width to elements, if necessary?
Hello everyone, there is an event that, if necessary, adds the width of the block. Made for the purpose of visualization of elements. They all look the same.
$.fn.equivalent = function (){
var $blocks = $(this),
maxH = $blocks.eq(0).height();
$blocks.each(function(){
maxH = ( $(this).height() > maxH ) ? $(this).height() : maxH;
});
$blocks.height(maxH); //устанавливаем найденное максимальное значение высоты для каждого блока jQuery выборки
}
$('.listing-card.col-md-2 .listing-attr.radius_app').equivalent(); //применяем нашу функцию в элементам jQuery выборки - $()
$('.listing-card.col-sm-6.col-md-4 .figure').equivalent(); //применяем нашу функцию в элементам jQuery выборки - $()
$(window).resize(function(){
$('.listing-card.col-md-2 .listing-attr.radius_app').css('height','auto').equivalent();
});
$(window).load(function () {
$('.listing-card-list').animate({
'opacity':1
},300);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question