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

<script>
$(document).ready(function(){
    $('#menu-top-1 li a').each(function(){
        if($($(this))[0].href==String(window.location))
            $(this).parent().addClass('active');
    });
})
</script>
原文地址:https://www.cnblogs.com/juebai/p/9621686.html