Browse Source

serviceList

liting2017 6 years ago
parent
commit
4a526b8412
2 changed files with 15 additions and 1 deletions
  1. 1 0
      src/css/newMenu/index.css
  2. 14 1
      src/js/newMenu/patentList.js

+ 1 - 0
src/css/newMenu/index.css

@@ -609,6 +609,7 @@
 }
 .news div ul li a .time span{
     display: inline-block;
+    width: 74px;
     margin-bottom: 4px;
     color: #000000;
     font-size: 16px;

+ 14 - 1
src/js/newMenu/patentList.js

@@ -149,14 +149,27 @@ $(function () {
                             })
                             theArrs.push(`
                                 </ul>
-                                ${item.children.length>7?'<a href="javascript:void(0);" class="more">更多+</a>':''}
+                               
                             </div>
                         </div>
                         `)
                         }
 
                     })
+
                     $('.serviceList').html(theArrs.join(''));
+                    let ind = $('.serviceList .industry'),
+                        ulW = $('.industryList ul').width();
+                    for(let i=0;i<ind.length;i++){
+                        let thisUl=ind[i],totalW=0,
+                            othLis = $(thisUl).find('.industryList ul li');
+                        for(let j =0;j<othLis.length;j++){
+                           totalW+=othLis[j].offsetWidth;
+                        }
+                        if(totalW>ulW){
+                            $(thisUl).find('.industryList').append(`<a href="javascript:void(0);" class="more">更多+</a>`)
+                        }
+                    }   
                     onSelect(thisdata);
                     jump();
                     $('footer').show();