JQ实现当前页面导航加效果(栏目页有效)

<script>
$(document).ready(function(){
    $('#menu-top-1 li a').each(function(){
        if($($(this))[0].href==String(window.location))
            $(this).parent().addClass('active');
    });
})
</script>
posted @ 2018-09-10 18:29  觉白  阅读(298)  评论(0编辑  收藏  举报