Explorar el Código

说明书菜单栏高亮和内容匹配

zhangxc hace 6 años
padre
commit
0d8cecb09a

+ 1 - 1
src/components/PushItems/DetailsModal/index.jsx

@@ -40,7 +40,7 @@ class DetailsModal extends Component {
         const scrollTop = $('#detailsContent').scrollTop()
         let divHeight = 0;
         for (let i = 0; i < tipsDetails.introduceDetailList.length; i++) {
-            divHeight = divHeight + parseInt($('#' + tipsDetails.introduceDetailList[i].title).css('height'))
+            divHeight = divHeight + parseInt($('#' + tipsDetails.introduceDetailList[i].title).css('height')) -5
             if(divHeight > scrollTop) {
                 this.setState({
                     currentIndex: i

+ 1 - 1
src/components/TreatDesc/DrugInfo/index.jsx

@@ -37,7 +37,7 @@ class DrugInfo extends Component {
         const scrollTop = $('#drugDesc').scrollTop()
         let divHeight = 60; //标题高度为60px
         for (let i = 0; i < drugDesc.length; i++) {
-            divHeight = divHeight + parseInt($('#' + drugDesc[i].title.trim()).css('height'))
+            divHeight = divHeight + parseInt($('#' + drugDesc[i].title.trim()).css('height')) -5
             if(divHeight > scrollTop) {
                 this.setState({
                     currentIndex: i