window.onresize = function() {
if(window.matchMedia("(max-width: 560px)").matches){
window.onresize = function() {
if(window.matchMedia("(max-width: 560px)").matches){
doSomething();
}
}
window.onload = function(){
if(window.matchMedia("(max-width: 560px)").matches){
doSomething();
}
}
function doSomething(){
// что хотите делать при 560px
}
var link = document.querySelector("#nav-toggle");
var menu = document.querySelector(".menu");
window.onresize = function() {
if(window.matchMedia("(max-width: 560px)").matches){
document.querySelector('.menu').classList.add('resized');
document.querySelector('#nav-toggle').classList.add('notransporent');
link.addEventListener("click", function(event) {
event.preventDefault();
menu.classList.remove('resized');
menu.classList.add('show');
});
}
else {
document.querySelector('.menu').classList.remove('resized');
document.querySelector('#nav-toggle').classList.remove('notransporent');
}
};
(function(){
window.onresize = function() {
doDich();
}
window.onload = function(){
doDich();
}
function doDich(){
if(window.matchMedia("(max-width: 560px)").matches){
add();
}
else
{
remove();
}
}
function add(){
document.querySelector('.menu').classList.add('resized');
document.querySelector('#nav-toggle').classList.add('notransporent');
link.addEventListener("click", function(event) {
event.preventDefault();
menu.classList.remove('resized');
menu.classList.add('show');
});
}
function remove(){
document.querySelector('.menu').classList.remove('resized');
document.querySelector('#nav-toggle').classList.remove('notransporent');
}
})();
window.onresize = function() {
if(window.matchMedia("(max-width: 560px)").matches){
doSomething();
}
};
window.onload = function(){
if(window.matchMedia("(max-width: 560px)").matches){
doSomething();
}
};
function doSomething(){
var link = document.querySelector("#nav-toggle");
var menu = document.querySelector(".menu");
document.querySelector('.menu').classList.add('resized');
document.querySelector('#nav-toggle').classList.add('notransporent');
link.addEventListener("click", function(event) {
event.preventDefault();
menu.classList.remove('resized');
menu.classList.add('show');
});
else {
document.querySelector('.menu').classList.remove('resized');
document.querySelector('#nav-toggle').classList.remove('notransporent');
}
}
window.onresize = function() {
doSomething();
};
window.onload = function(){
doSomething();
};
function doSomething(){
var link = document.querySelector("#nav-toggle");
var menu = document.querySelector(".menu");
if(window.matchMedia("(max-width: 560px)").matches){
document.querySelector('.menu').classList.add('resized');
document.querySelector('#nav-toggle').classList.add('notransporent');
link.addEventListener("click", function(event) {
event.preventDefault();
menu.classList.remove('resized');
menu.classList.add('show');
});
else {
document.querySelector('.menu').classList.remove('resized');
document.querySelector('#nav-toggle').classList.remove('notransporent');
}
}
}
window.onresize = function() {
if(window.matchMedia("(max-width: 560px)").matches){
indow.onresize = function() {
if(window.matchMedia("(max-width: 560px)").matches){