From 12ba7e43fef574d9c2e9cef3cf2339dd66e445ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20Gl=C3=BCck?= Date: Mon, 19 May 2025 09:02:50 +0200 Subject: [PATCH] Possibility to import as a module too With this small change, is possible to use dynamic import too: import(../pathto/trig.js).then(module => { trig.trigInit() }); --- src/trig.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trig.js b/src/trig.js index edd8297..f84d957 100755 --- a/src/trig.js +++ b/src/trig.js @@ -238,8 +238,8 @@ class Trig } } } -const trig = new Trig; +window.trig = new Trig; window.addEventListener("scroll", trig.trigScroll, { passive: true }); window.addEventListener('resize', trig.trigWindowHeight, { passive: true }); -window.addEventListener('load', trig.trigInit, { passive: true }); \ No newline at end of file +window.addEventListener('load', trig.trigInit, { passive: true });