Skip to content

Commit 1930354

Browse files
committed
スマホなどのリサイズ時のバグを調整
1 parent 00ce446 commit 1930354

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

dist/js-scroll-effect-module.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js-scroll-effect-module.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export default class SCROLL_EFFECT_MODULE {
3737

3838
throttleInterval : 5,
3939

40+
updateResizeAuto : true,
41+
4042
customVarNameRatio : null, // '--sem-scroll-ratio'
4143

4244
on: {
@@ -101,8 +103,19 @@ export default class SCROLL_EFFECT_MODULE {
101103
if(this.timer) clearTimeout(this.timer);
102104

103105
// for Resize-Event
106+
let currentWidth = window.innerWidth;
104107
this.state.$parent.addEventListener('resize', () => {
105-
this.Start();
108+
// not resize
109+
if (currentWidth == window.innerWidth) {
110+
return;
111+
}
112+
113+
// update window width
114+
currentWidth = window.innerWidth;
115+
116+
if(this.config.updateResizeAuto){
117+
this.Start();
118+
}
106119
});
107120

108121
if(this.config.autoStartType === 'ready'){

0 commit comments

Comments
 (0)