js菜单默认选中

function defaultSelected() {
        var curr = $("#leftTree li[onclick*='" + $("#content_iframe").attr("src") + "']");
        if (curr.size() > 0) {
            $(curr[0]).addClass("selected");
            $("#leftTree li:not([onclick*='" + $("#content_iframe").attr("src") + "'])").removeClass("selected");
        }
    }

 

转载于:https://www.cnblogs.com/gaocong/p/6204075.html

你可能感兴趣的:(js菜单默认选中)