某项已经打开的菜单,再次点击菜单时当前页面不刷新。

$(".su_tree").on("click",".su_children .su_node_data",function(){

        var that = $(this);

        $(this).find(".active").css({"width":"0"})//,"marginLeft":"70px","borderRadius":"50%"

        $(this).find(".active").animate({"width":"100%"},300)//,"marginLeft":"0px","borderRadius":"0"

        index_reset(that);     

    })


    function index_reset(that){

        var len = $(".su_children .su_node_data").length;

         for(var i=0;i

             var divsrc =  $(".su_children .su_node_data").eq(i).find(".su_node_icon>img"),

                srcs = divsrc.attr("src");

                 srcs = srcs.split("_2").join("");

             divsrc.attr("src",srcs)/*.css({"width":"16px","height":"16px","marginTop":"-3px","marginLeft":"0px"});*/

             $(".su_children .su_node_data").eq(i).find(".su_node").removeClass("su_node_bj")

         }

        var urls = that.find(".su_node_icon>img").attr("src");

        urls = urls.split(".") 

        urls[urls.length-2]  = urls[urls.length-2]+"_2"

        urls  = urls.join(".")        

        that.find(".su_node_icon>img").attr("src",urls)/*.css({"width":"28px","height":"28px","marginTop":"-4px","marginLeft":"-9px"})*/    

        that.find(".su_node").addClass("su_node_bj")

    }

就是第一次点击tree节点可以出来tab,要求是每次点击就要刷新

你可能感兴趣的:(java)