Hello.
I want to do that border-top color will change, then the new post appeared, or then the new post in categories.
css code:
it only work on one categorie, and its working even there is no new posts.
I want to do that border-top color will change, then the new post appeared, or then the new post in categories.
css code:
- Code:
.lastpost {
width: 150px;
padding: 15px;
background: #F7F7F7;
text-align: center;
font: 700 8px/120% Montserrat, sans-serif;
text-transform: uppercase;
color: #777;
display: block;
overflow: hidden;
margin-left: 160px;
border-top: 10px solid;
border-top-color: #000000; /* Pradinė spalva (juoda) */
transition: border-top-color 0.5s ease; /* Pritaikyti spalvos pakeitimui animaciją */
}
.lastpost.new {
border-top-color: #ff0000; /* Naujo pranešimo spalva (raudona) */
}
- Code:
function addNewPost() {
var lastpostElement = document.querySelector('.lastpost');
lastpostElement.style.borderTopColor = '#ff0000';
}
// addNewPost() after time
setTimeout(addNewPost, 2000);
it only work on one categorie, and its working even there is no new posts.
Last edited by unownus on June 26th 2023, 1:55 pm; edited 1 time in total