CSS 頁面刷新添加和移除 class 樣式

$(document).ready(function(){
        $('.p-menu li a').each(function() {
        if($($(this))[0].href == String(window.location))
                $(this).parent().addClass('active');
        });
})this

相關文章
相關標籤/搜索