File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ export default class SCROLL_EFFECT_MODULE {
157157 if ( el . dataset && el . dataset . semOffset !== undefined ) offset = Number ( el . dataset . semOffset ) ;
158158 let obj = {
159159 el : el ,
160- index : i ,
160+ index : i + 1 ,
161161 pos : el . getBoundingClientRect ( ) . top + this . state . NumScrolltop - offset ,
162162 height : el . clientHeight ,
163163 height2 : el . offsetHeight ,
@@ -169,6 +169,25 @@ export default class SCROLL_EFFECT_MODULE {
169169 this . state . PosList . push ( obj ) ;
170170 } ) ;
171171 }
172+
173+ // Add Top body position.
174+ let obj = {
175+ el : document . body ,
176+ index : 0 ,
177+ pos : 0 ,
178+ height : 0 ,
179+ height2 : 0 ,
180+ count : 0 ,
181+ active : false ,
182+ changing : false ,
183+ dataset : document . body . dataset
184+ } ;
185+ this . state . PosList . unshift ( obj ) ;
186+
187+ // sort by position
188+ this . state . PosList . sort ( ( a , b ) =>
189+ a . pos > b . pos ? 1 : - 1
190+ ) ;
172191 }
173192
174193 _StoreElementStateAtPosList ( ) {
You can’t perform that action at this time.
0 commit comments