JavaScript
9
Вклад в тег
let count = Math.round(array.lenght / 5) // array - ваш массив
let columns = []
columns.length = count
<div *ngFor="let column of columns; let i = index"></div>
<div *ngFor="let column of columns; let i = index">
<span *ngFor="let item of newArrays[i]> {{ item }} <span>
</div>
if(target.className === 'filter__btn') {
filteringGallery(target.id);
};
window.onload = function () {
startTimer(5, document.getElementById("time")); // 5 - сколько секунд ; document.getElementById("time") - блок, где нужно значение
startTimer(10, document.getElementById("time1"));
};
function startTimer(duration, display) {
var start = Date.now(),
diff,
minutes,
seconds;
function timer() {
diff = duration - (((Date.now() - start) / 1000) | 0);
minutes = (diff / 60) | 0;
seconds = (diff % 60) | 0;
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;
if ( minutes === '00' && seconds === '00') {
display.textContent = 'текст'; // тут ваш текст
clearInterval(interval)
} else {
display.textContent = minutes + ":" + seconds;
}
if (diff <= 0) {
start = Date.now() + 1000;
}
};
var interval = setInterval(timer, 1000);
timer();
}