zhangxc 5 anos atrás
pai
commit
f1e299b500
2 arquivos alterados com 19 adições e 1 exclusões
  1. 1 1
      src/css/information.less
  2. 18 0
      src/js/information.js

+ 1 - 1
src/css/information.less

@@ -177,7 +177,7 @@
     border-radius: 0;
     border: none;
     background-color: #F5F6F7;
-    background: url('../images/icon_current.png') center center no-repeat;
+    // background: url('../images/icon_current.png') center center no-repeat;
   }
   .infos>.downBox{
     margin-right: 0;

+ 18 - 0
src/js/information.js

@@ -10,12 +10,17 @@ const {
 const $ = require("jquery");
 let TxtICon = require('./../images/txtIcon.png')
 let VedioIcon = require('./../images/vedioIcon.png')
+let currentIcon = require('./../images/icon_current.png')
+
+
 
 if(isIe8()) {
   let reg = /undefined/g
   TxtICon = TxtICon.replace(reg, '')
   VedioIcon = VedioIcon.replace(reg, '')
+  currentIcon = currentIcon.replace(reg, '')
 }
+
 const isLocal = window.location.hostname.indexOf('localhost') !=-1;
 function getInfomation() {
   var param = {
@@ -100,6 +105,7 @@ function getInfomation() {
           str = `<div class="infoWrapper">${str}</div>`
         $(".infos").append(str);
         $(".anchors ul").append(anchors);
+        
       }
     }
     
@@ -117,6 +123,7 @@ function getInfomation() {
         if (divHeight > scrollTop) {
           var anchor = 2 * (i);
           $('.anchors ul').children().eq(anchor).addClass('active').siblings().removeClass('active');
+          setBackground()
           return;
         }
       }
@@ -128,12 +135,23 @@ getInfomation();
 
 function addLinkClickEvent() {
   $(".anchors ul li:first").addClass("active");
+  setBackground()
   $(".anchors ul li>a").on("click", function () {
     $(".active").removeClass('active');
     $(this).parent().addClass("active");
+    setBackground()
   });
 }
 
+function setBackground(){
+  $(".anchors  i").css({
+    background:"#E0E2E3"
+  })
+  $(".anchors .active i").css({
+    background:`url(${currentIcon})   center center no-repeat`
+  })
+}
+
 function downLoadFile() {
   $(".download").on("click", function(){
     const downUrl = $(this).attr('data-url')