suomingxiang 4 miesięcy temu
rodzic
commit
59d80febba

+ 8
- 2
src/pages/intoTime/App.js Wyświetl plik

92
                             }
92
                             }
93
                         
93
                         
94
                     });
94
                     });
95
-                    console.log(scrollY,ulScrolls);
95
+                    let documentHeight = document.documentElement.scrollHeight; // 文档总高度
96
+                    let viewportHeight = window.innerHeight; // 视口高度
97
+                    const heightThreshold = documentHeight - viewportHeight - 249; // 计算阈值
98
+                    let dom = document.querySelector('.timeYear')
99
+                    dom.style.opacity = (scrollY >= heightThreshold) ? '0' : '1';
100
+                   
101
+                    // console.log(scrollY,ulScrolls);
96
                     
102
                     
97
-                } catch (error) { }
103
+                } catch (error) { console.log(error)}
98
             }
104
             }
99
             window.addEventListener('scroll', updateScrollChange1);
105
             window.addEventListener('scroll', updateScrollChange1);
100
         }
106
         }

+ 2
- 0
src/pages/intoTime/index.less Wyświetl plik

32
     position: sticky;
32
     position: sticky;
33
     top: 170px;
33
     top: 170px;
34
     z-index: 2;
34
     z-index: 2;
35
+    opacity: 1;
36
+    transition: all .1s;
35
     &>div{
37
     &>div{
36
       width: 212px;
38
       width: 212px;
37
       position: absolute;
39
       position: absolute;

+ 1
- 0
src/pages/socialResponsibility/App.js Wyświetl plik

49
                 tabs_ul[1].classList.add('tabs_lis')
49
                 tabs_ul[1].classList.add('tabs_lis')
50
                 news_ul.style.display = 'none';
50
                 news_ul.style.display = 'none';
51
                 typeCon.style.display = 'block';
51
                 typeCon.style.display = 'block';
52
+                this.fold()
52
             }else{
53
             }else{
53
                 tabs_ul[0].classList.add('tabs_lis')
54
                 tabs_ul[0].classList.add('tabs_lis')
54
                 news_ul.style.display = 'block';
55
                 news_ul.style.display = 'block';

Ładowanie…
Anuluj
Zapisz