JQuery实现页面刷新后菜单保留鼠标点击addclass的样式

来源:互联网 发布:mac terminal 有趣 编辑:程序博客网 时间:2024/04/30 06:15

使用Jquery

    $(function () {        $("#divLefMenu li a").each(function () {            if ($($(this))[0].href == String(window.location))                $(this).parent().addClass('hover');        });    });

1 0
原创粉丝点击