首页 > Linux操作系统 > Linux操作系统 > 访问页面对应的标题高亮显示
点击(此处)折叠或打开
2 js
$(function(){
$(window).on("load hashchange",function(){
$("#menu-list").find('a').each(function(){
var url = window.location.protocol + '//' + window.location.hostname + ':' + location.port
if (url + $(this).attr('href') == String(window.location)) {
$(this).addClass("active");
}
});
});
});
3 css
.trigger-menu li a{
font-size: 15px;
font-weight: bold;
color: #a3a3a3;
}
.trigger-menu li a:hover {
box-shadow: 0 2px #3d3d3d;
color: #a6a6a6;
}
.trigger-menu .active {
box-shadow: 0 2px #3d3d3d;
color: #3d3d3d;
}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27181165/viewspace-2143189/ ,如需转载,请注明出处,否则将追究法律责任。