Skip to content

Instantly share code, notes, and snippets.

@Burick
Last active April 4, 2017 11:55
Show Gist options
  • Save Burick/64a2eb788621f811e422221c771d26c3 to your computer and use it in GitHub Desktop.
Save Burick/64a2eb788621f811e422221c771d26c3 to your computer and use it in GitHub Desktop.
Вычисляет самый высокий столбец и все остальные в наборе делает по его высоте
/*
функция опледеления элемента
с наибольшей высотой
*/
$(function(){
function setEqualHeight(columns){
var tallestcolumn = 0;
columns = $(columns);
columns.each(
function(){
currentHeight = $(this).height();
if(currentHeight > tallestcolumn)
{
tallestcolumn = currentHeight;
}
}
);
columns.height(tallestcolumn);
}
setEqualHeight('.news-block .action-i');
});
/*
Использоваие
setEqualHeight($('.selector'));
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment