From e04b44b66a841fb123842ce7e1b3932fb2fc2b7c Mon Sep 17 00:00:00 2001 From: leijun Date: Thu, 27 Sep 2018 18:18:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Djs=E6=8E=A7=E5=88=B6=E5=8F=B0?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/static/global/scripts/common.js | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index cabd9b5d0..b86bbc896 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -600,18 +600,21 @@ window.onload=function(){ heightDiv(); },500); - var tableCont = document.querySelector('.table-responsive'); - function scrollHandle (e){ - console.log(this); - var scrollTop = this.scrollTop; - $('th').css('transform','translateY(' + scrollTop + 'px)'); - $('thead tr').css('z-index','2147482468'); - $('thead tr').css('position','relative'); - $('th').css('border','1px solid rgb(255, 255, 255)'); - $('th').css('background-clip','padding-box'); - } - tableCont.addEventListener('scroll',scrollHandle); - $('#contentTable').attr("margin-top",'0px'); + if($('.table-responsive')){ + var tableCont = document.querySelector('.table-responsive'); + if(tableCont !=null && tableCont!=''){ + function scrollHandle (e){ + var scrollTop = this.scrollTop; + $('th').css('transform','translateY(' + scrollTop + 'px)'); + $('thead tr').css('z-index','2147482468'); + $('thead tr').css('position','relative'); + $('th').css('border','1px solid rgb(255, 255, 255)'); + $('th').css('background-clip','padding-box'); + } + tableCont.addEventListener('scroll',scrollHandle); + $('#contentTable').attr("margin-top",'0px'); + } + } } var setInterceptDefaultInfo=function(cfgId){ var action=$("input[name='action']:checked").val();