<style>
.t-col_5-12 {
max-width: 200px;
}
@media (max-width: 1200px) {
.t-col_5-12 {
max-width: 172px;
}
}
@media (max-width: 960px) {
.t-col_5-12 {
max-width: 100%;
}
}
</style>
<script>
setCustomCols('.uc-sixcols', 6);
setCustomCols('.uc-fivecols', 5);
function setCustomCols(id, cols = 5) {
const $wrapper = $(id);
let className = 't-col_5-12';
if (cols === 6) {
className = 't-col_2';
}
const $cols = $wrapper
.find('.t491__col, .t502__col, .t503__col, .t850__col, .t851__col')
.removeClass('t-col_12 t-col_6 t-col_4 t-col_3')
.addClass(className);
let $clear = $wrapper.find('.t-clear');
$cols
.filter((idx) => idx && !(idx % cols))
.each(function() {
$(this).before($clear.clone());
});
$clear.remove();
if ($wrapper.find('.t850').length) {
$cols.unwrap('.t850__row');
for (let i = 0; i < $cols.length; i += cols) {
$cols.slice(i, i + cols).wrapAll('<div class="t850__row"></div>');
}
}
} // Инструкция по работе со скриптом https://trilda.ru/kak-sdelat-5-ili-6-kartochek-v-stroku
</script>