|
@@ -34,7 +34,11 @@ export default class App {
|
34
|
34
|
// item.load();
|
35
|
35
|
}
|
36
|
36
|
});
|
37
|
|
- this.four();
|
|
37
|
+ let _this=this;
|
|
38
|
+ $(document).ready(function() {
|
|
39
|
+ _this.four();
|
|
40
|
+ });
|
|
41
|
+
|
38
|
42
|
}
|
39
|
43
|
four() {
|
40
|
44
|
let isMob = this.isMobile;
|
|
@@ -67,32 +71,38 @@ export default class App {
|
67
|
71
|
if (index > 0) {
|
68
|
72
|
fourRsons[index - 1].style.clipPath = 'inset(0px 0px 100%)';
|
69
|
73
|
}
|
|
74
|
+ fourRsons[index + 1].style.clipPath = 'inset(0px 0px 0%)';
|
70
|
75
|
}
|
71
|
76
|
if (index < fourSons.length) fourSons[index + 1].style.opacity = 0.3 + (val > 0.7 ? 0.7 : val);
|
72
|
77
|
}
|
73
|
78
|
})
|
74
|
79
|
}
|
75
|
80
|
|
76
|
|
-
|
|
81
|
+ //锚点跳转
|
|
82
|
+ let jumpM='';
|
|
83
|
+ if(window.location.href.indexOf("intoZz.html?") !== -1){
|
|
84
|
+ let ss=window.location.href.indexOf('=');
|
|
85
|
+ let afterHash = window.location.href.substring(ss + 1);
|
|
86
|
+ console.log(afterHash,88);
|
|
87
|
+ jumpM="#"+afterHash;
|
|
88
|
+ $(window).scrollTop(10);
|
|
89
|
+ // $("#"+afterHash).offset().top
|
|
90
|
+ }
|
77
|
91
|
// 获取元素的滚动条高度
|
78
|
92
|
let scrollHeight = fourCon.scrollHeight;
|
79
|
93
|
let conStart = 0;
|
80
|
94
|
let conEnd = 0;
|
81
|
95
|
function updateScrollChange1() {
|
|
96
|
+
|
82
|
97
|
try {
|
83
|
|
- let hh = fourCon.getBoundingClientRect();
|
84
|
|
- let scrollTop = hh.top;
|
85
|
|
- let scrollBottom = hh.bottom;
|
86
|
98
|
let scrollY = window.scrollY;
|
87
|
|
-
|
88
|
|
-
|
89
|
|
- if (scrollTop < 0 & conStart == 0) {
|
90
|
|
- conStart = scrollY;
|
91
|
|
- conEnd = scrollY + scrollHeight;
|
|
99
|
+ if(conStart==0){
|
|
100
|
+ conStart = $(".fourCon").offset().top;
|
|
101
|
+ conEnd = conStart+$(".fourCon").height();
|
92
|
102
|
let startH = 0;
|
93
|
103
|
sonArr.forEach((item, index) => {
|
94
|
|
- let childH = scrollY + startH + item[0];
|
95
|
|
- let childHs = scrollY + startH;
|
|
104
|
+ let childH = conStart + startH + item[0];
|
|
105
|
+ let childHs = conStart + startH;
|
96
|
106
|
if(index==0){
|
97
|
107
|
startH += item[0]-80;
|
98
|
108
|
}else{
|
|
@@ -101,10 +111,18 @@ export default class App {
|
101
|
111
|
item.push(childH)
|
102
|
112
|
item.push(childHs)
|
103
|
113
|
});
|
104
|
|
- } else if (scrollTop < 0 && scrollY > conStart && scrollY < conEnd) {
|
105
|
|
-
|
106
|
|
-
|
107
|
|
-
|
|
114
|
+ if(jumpM!=''){
|
|
115
|
+ let jj=$(jumpM).offset().top;
|
|
116
|
+ $('html, body').animate({
|
|
117
|
+ scrollTop: jj
|
|
118
|
+ }, 'slow',function(){
|
|
119
|
+ // new WOW().init();
|
|
120
|
+ });
|
|
121
|
+ }
|
|
122
|
+ console.log(scrollY, 'scrollY',conStart,conEnd)
|
|
123
|
+
|
|
124
|
+ }
|
|
125
|
+ if (scrollY > conStart && scrollY < conEnd) {
|
108
|
126
|
sonArr.forEach((item, index) => {
|
109
|
127
|
let chazhi = item[2] - scrollY;
|
110
|
128
|
if (chazhi > 0 && scrollY < item[2] && scrollY > item[3]) {
|
|
@@ -118,13 +136,25 @@ export default class App {
|
118
|
136
|
}
|
119
|
137
|
});
|
120
|
138
|
}
|
121
|
|
- } catch (error) { }
|
|
139
|
+ } catch (error) {
|
|
140
|
+ console.log(error);
|
|
141
|
+
|
|
142
|
+ }
|
122
|
143
|
}
|
123
|
144
|
|
124
|
145
|
|
125
|
146
|
// 添加滚动事件监听器
|
126
|
147
|
if(!isMob){
|
127
|
148
|
window.addEventListener('scroll', updateScrollChange1);
|
|
149
|
+ }else{
|
|
150
|
+
|
|
151
|
+ if(jumpM!=''){
|
|
152
|
+ new WOW().init();
|
|
153
|
+ let jj=$(jumpM).offset().top;
|
|
154
|
+ $('html, body').animate({
|
|
155
|
+ scrollTop: jj
|
|
156
|
+ }, 'slow');
|
|
157
|
+ }
|
128
|
158
|
}
|
129
|
159
|
|
130
|
160
|
//弹框资质荣誉
|