Przeglądaj źródła

修改菜单箭头(3756)

zhangxc 5 lat temu
rodzic
commit
4e6c8b0e37
3 zmienionych plików z 14 dodań i 1 usunięć
  1. 6 1
      src/css/index.less
  2. BIN
      src/images/icon_up.png
  3. 8 0
      src/js/index.js

+ 6 - 1
src/css/index.less

@@ -93,7 +93,7 @@
   .slide-up{
     color: @activeColor;
   }
-  .list-1{
+  .list-1,.list-1-show{
     position: relative;
     &:after{
       content: " ";
@@ -122,6 +122,11 @@
       }
     }
   }
+  .list-1-show{
+    &:after{
+      background: url("../images/icon_up.png") no-repeat;
+    }
+  }
   .page:hover {
     color: @activeColor;
   }

BIN
src/images/icon_up.png


+ 8 - 0
src/js/index.js

@@ -35,7 +35,15 @@ function initMenu(data,userInfo){
   $(".list-1").on("click",function(){
     // $(".list-1 .slide-up").removeClass('slide-up');
     // $(this).toggleClass('slide-up');
+    const ulShow =  $(this).find("ul").css("display")
+    if(ulShow == "none"){
+      $(this).removeClass("list-1-show")
+      $(this).addClass("list-1-show")
+    }else{
+      $(this).removeClass("list-1-show")
+    }
     $(this).find("ul").slideToggle();
+    
   });
   $(".list-1 li").on("click",function(e){
     e.stopPropagation();