document.addEventListener('DOMContentLoaded', () => {
const link = document.querySelector('#phone');
let activeIndex = 0;
const numbers = ['+38 (095) 123 45 67', '+38 (098) 123 45 67', '+38 (111) 111 11 11'];
setNumber(numbers[activeIndex]);
setInterval(() => {
setNumber(numbers[activeIndex]);
activeIndex = (activeIndex + 1) % numbers.length;
}, 2000);
function setNumber(number) {
link.innerText = number;
link.setAttribute('href', 'tel:' + number);
}
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.one{
width: 400px;
height: 400px;
background: green;
}
.list{
width: 100px;
height: 100px;
background: #00B7FF;
}
</style>
</head>
<body>
<div class="one">
<div class="list"></div>
</div>
<script>
let list =document.getElementsByClassName('list')[0];
setTimeout(()=>list.parentElement.style.background="red",2000)
</script>
</body>
</html>
.construction_item a:after {
content: '\276F';
padding-left: 0.5em;
animation: slide-icon alternate 3s infinite;
display: inline-block;
}
@keyframes slide-icon {
0% { transform: translate(0, 0); }
100% { transform: translate(10px, 0); }
}