We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2eb9415 commit f792859Copy full SHA for f792859
js/theme.js
@@ -29,16 +29,21 @@ function ThemeNav () {
29
// Set scroll monitor
30
self.win.on('scroll', function () {
31
if (!self.linkScroll) {
32
- self.winScroll = true;
+ if (!self.winScroll) {
33
+ self.winScroll = true;
34
+ requestAnimationFrame(self.onScroll.bind(self));
35
+ }
36
}
37
});
- setInterval(function () { if (self.winScroll) self.onScroll(); }, 25);
38
39
// Set resize monitor
40
self.win.on('resize', function () {
- self.winResize = true;
41
+ if (!self.winResize) {
42
+ self.winResize = true;
43
+ requestAnimationFrame(self.onResize.bind(self));
44
45
- setInterval(function () { if (self.winResize) self.onResize(); }, 25);
46
+
47
self.onResize();
48
49
};
0 commit comments