当前位置:首页 > 未命名

zblog导航高亮js版

8976988821个月前 (01-10)未命名4

没有高亮的导航是没有灵魂的,然后开始我们的教程吧。

1、根据《zblog二级导航下拉导航多级导航配置设置教程》设置html代码;

2、给对应的导航ui层添加id属性。

id=divNavBar

3、添加css文件

#divNavBar a.on {color: #FCEE8B;}

4、添加js文件

$(document).ready(function() {    var s = document.location    $("#divNavBar a").each(function() {      if (this.href == s.toString().split("#")[0]) {        $(this).addClass("on")        return false      }    })})

5、完工。

这个时候,再去点击导航对应的链接,就会发现,导航高亮已经生效了。

扫描二维码推送至手机访问。

版权声明:本文由米表程序发布,如需转载请注明出处。

本文链接:https://www.9909999.xyz/post/391.html

分享给朋友: