mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 04:01:20 -08:00
separate variable constants
This commit is contained in:
1 parent
57a14f63ac
commit
fc3abd7d1d
20 files changed
+143
-80
No files matched your search
@@ -3,12 +3,13 @@ import { throttle, isInViewport } from '../utils';
|
||||
export default function viewInit(art, events) {
|
||||
const {
|
||||
option,
|
||||
constructor,
|
||||
template: { $container },
|
||||
} = art;
|
||||
|
||||
const scrollFn = throttle(() => {
|
||||
art.emit('view', isInViewport($container, 50));
|
||||
}, 200);
|
||||
art.emit('view', isInViewport($container, constructor.SCROLL_GAP));
|
||||
}, constructor.SCROLL_TIME);
|
||||
|
||||
events.proxy(window, 'scroll', () => {
|
||||
scrollFn();
|
||||
|
||||
Reference in new issue
Block a user