皮肤切换和菜单收起

$(function () {
            $("#skin li").click(function () {
                //拼接皮肤地址
                var css = "styles/skin/" + $(this).attr("id") + ".css";
                //修改当前页面皮肤
                $("#cssfile").attr("href", css);
                //单击对象选中,其余对象不选中
                $(this).addClass("selected").siblings().removeClass("selected");

            })
            $(".module_up_down img:eq(0)").click(function () {
                var $this = $(this);
                $(".scrollNews").slideToggle(1000, function () {
                    var img = $this.attr("src");
                    if (img == "images/up.gif") {
                        img = "images/down.gif";
                    }
                    else {
                        img = "images/up.gif";
                    }
                    $this.attr("src", img)
                })
            })
            $(".module_up_down img:eq(1)").click(function () {
                var $this = $(this);
                $(".m-treeview").slideToggle(1000, function () {
                    var img = $this.attr("src");
                    if (img == "images/up.gif") {
                        img = "images/down.gif";
                    }
                    else {
                        img = "images/up.gif";
                    }
                    $this.attr("src", img)
                })
            })
            $(".m-treeview > li").click(function () {
                var cl = $(this).attr("class");
                if (cl == "m-collapsed") {
                    $(this).attr("class", "m-expanded");
                }
                else if (cl == "m-expanded") {
                    $(this).attr("class", "m-collapsed");
                }
            })

猜你喜欢

转载自blog.csdn.net/Charles_hui/article/details/108915917