Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
9370 มุมมอง

Hello All,

How can I change my website home page menu color?

I have tried this below code using JS.

if (window.location.pathname == '/'){

$('.nav-link.show, .navbar-light .navbar-nav').css('color', '#fff!important');

});

but this code is not working properly.

Please help me out of the issue.

Thanks in advance.

Riddhi


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello @Riddhi,

You can use this code,

Hello @Riddhi,


You can use this code.


Add css


.home-menu{


color:#000!important;


}


Js code


$(document).ready(function(){


if (window.location.pathname == '/'){


$('.nav-link').addClass('home-menu')


}


});


Can you please mark this as a resolved if you are satisfied with my answer.

อวตาร
ละทิ้ง
ผู้เขียน

Thanks :)

คำตอบที่ดีที่สุด

thanks!! it works!!!, do you know the code for onhover color? =)


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 25
10418
Website customization แก้ไขแล้ว
1
เม.ย. 24
4011
1
ก.พ. 23
4059
0
ต.ค. 21
3054
3
ต.ค. 20
5486