const list = document.querySelectorAll('.CatalogMenu li a')
list.forEach(item =>{
item.addEventListener('click', (e) =>{
list.forEach(el=>{ el.classList.remove('active'); });
item.classList.add('active')
})
})
.parent {
display: block;
width: calc(100% - (2 * 70px));
height: 300px;
background-color: yellow;
margin: 0 70px;
box-sizing: content-box;
}
export const Media = () => {
const mqList = [
window.matchMedia('(min-width: 0px) and (max-width: 768px)'),
window.matchMedia('(min-width: 768px) and (max-width: 992px)'),
window.matchMedia('(min-width: 992px)'),
];
function mqIf() {
if (mqList[0].matches) {
document.querySelector('body').style.background = 'red';
}
if (mqList[1].matches) {
document.querySelector('body').style.background = 'white';
}
if (mqList[2].matches) {
document.querySelector('body').style.background = 'green';
}
}
mqIf();
for (let i = 0; i < mqList.length; i += 1) {
mqList[i].addEventListener('change', mqIf);
}
};
import media from './file-name.js';
<div>
<video></video>
<video></video>
<video></video>
</div>
<button>серия1</button>
<button>серия2</button>
<button>серия3</button>
let number = 11000000/3;
const input = document.querySelector('input');
const rounded = function(number){
return +number.toFixed(2);
}
let str = rounded(number);
input.value = str.toString().replace(/(^0|[A-Za-zА-Яа-яЁё]|\s)/, '').replace(/(\d)(?=(\d{3})+(\D|$))/g, '$1 ') + `p`;
// 3 666 666.67p