first commit
This commit is contained in:
40
templates/instytut_dendrologii_/js/krta.js
Normal file
40
templates/instytut_dendrologii_/js/krta.js
Normal file
@@ -0,0 +1,40 @@
|
||||
window.addEventListener('load', () => {
|
||||
boldi();
|
||||
})
|
||||
function boldi(){
|
||||
var link=window.location.href;
|
||||
var linkmaly=link.toLowerCase().replaceAll('-','');
|
||||
|
||||
if(link.includes('en-us')){
|
||||
document.querySelectorAll('.menu-instytut ul li a').forEach(lis => {
|
||||
|
||||
lis.style.removeProperty('font-weight');
|
||||
|
||||
})
|
||||
document.querySelectorAll('.menu-instytut ul li').forEach(lis => {
|
||||
console.log('boldi działa');
|
||||
|
||||
|
||||
var tekstmenu=lis.querySelector('a').innerHTML.toLowerCase().replaceAll(' ','');
|
||||
console.log(linkmaly);
|
||||
if(linkmaly.includes(tekstmenu)){
|
||||
lis.style.setProperty('font-weight','800');
|
||||
lis.querySelector('a').style.setProperty('font-weight','800');
|
||||
console.log(tekstmenu);
|
||||
|
||||
|
||||
}else {
|
||||
lis.style.removeProperty('font-weight');
|
||||
lis.querySelector('a').style.removeProperty('font-weight');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user