Last active
July 20, 2020 12:18
-
-
Save Fobiya/90135771acae120591fc5b6e1ed6b4d1 to your computer and use it in GitHub Desktop.
Js Native
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('.fish-characteristic li').forEach(function(item){ | |
item.addEventListener('click',function(){ | |
document.querySelectorAll('.fish-characteristic li').forEach(function(item){ | |
item.classList.remove('active'); | |
}); | |
var id = item.getAttribute('data-id'); | |
document.querySelectorAll('.content__text').forEach(function(item2){ | |
item2.style.display = "none"; | |
}); | |
document.querySelector('#' + id).style.display = "block"; | |
item.classList.add('active'); | |
}); | |
}); | |
// NATIVE LIST class link | |
document.querySelectorAll('.mte_news>.mte_new').forEach(function(item){ | |
item.addEventListener('click',function(item){ | |
this.querySelector("a.mte_news--link").click(); | |
}); | |
}); | |
/---------------------------------------------------------------------------------------------------/ | |
for(let link of document.querySelectorAll('.back_border')){ | |
link.onclick = (e) =>{ | |
if(e.target === link.querySelector('.link_open')){ | |
link.classList.toggle('active'); | |
// link.parentElement.classList.toggle('active'); | |
} | |
} | |
} | |
for(let link of document.querySelectorAll('.back_border')){
link.onclick = (e) =>{
if(e.target === link.querySelector('.link_open')){
link.classList.toggle('active');
// link.parentElement.classList.toggle('active');
}
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for(let link of document.querySelectorAll('.link_open')){
link.onclick = (e) =>{
e.preventDefault();
link.parentElement.parentElement.classList.toggle('active');
link.parentElement.classList.toggle('active');
}
}