first commit
This commit is contained in:
35
templates/instytut_dendrologii_/js/mod46.js
Normal file
35
templates/instytut_dendrologii_/js/mod46.js
Normal file
@@ -0,0 +1,35 @@
|
||||
window.addEventListener('load', () => {
|
||||
lightWhereiam();
|
||||
})
|
||||
|
||||
function lightWhereiam(){
|
||||
var menug='';
|
||||
var menug1='';
|
||||
document.querySelectorAll('.grid-menu1 .menugornear ul:nth-child(2) li a').forEach(lighted => {
|
||||
var link= window.location.href;
|
||||
var link1= lighted.getAttribute('href');
|
||||
|
||||
if(link.includes(link1)){
|
||||
|
||||
menug= link1.substring(2,link1.length).substring(0,link1.substring(2,link1.length).indexOf('/'));
|
||||
}
|
||||
})
|
||||
console.log(menug+'menu dolne');
|
||||
document.querySelectorAll('.grid-menu1 .menugornear ul:nth-child(2) li:not(ul) a').forEach(lighted1 => {
|
||||
|
||||
if(lighted1.getAttribute('href').includes(menug)){
|
||||
|
||||
// lighted1.style.setProperty('background-color','green', 'important');
|
||||
lighted1.parentNode.style.setProperty('background-color','green');
|
||||
lighted1.parentNode.style.setProperty('color','white');
|
||||
document.querySelectorAll('#'+lighted1.parentNode.id+' li a').forEach(items => {
|
||||
|
||||
|
||||
items.removeAttribute('style');
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user