40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
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');
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
} |