How to change active link color in bootstrap css?

前端 未结 9 854
余生分开走
余生分开走 2021-02-08 03:00

I am using joomla 3 and bootstrap.min.js I am creating menu and giving special class in order to change hover, active, visited links and style of the menu. I could not find how

9条回答
  •  梦如初夏
    2021-02-08 03:30

            $(function (){
                $('nav ul li a.sub-menu').each(function(){
                    var path = window.location.href;
                    var current = path.substring(path.lastIndexOf('/')+1);
                    var url = $(this).attr('href');
                    if(url == current){
                        $(this).addClass('active');
                    };
                });     
            });
    

提交回复
热议问题