aboutsummaryrefslogtreecommitdiff
path: root/assets_src/js/lib
diff options
context:
space:
mode:
Diffstat (limited to 'assets_src/js/lib')
-rw-r--r--assets_src/js/lib/dom.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/assets_src/js/lib/dom.js b/assets_src/js/lib/dom.js
index bfbeea7..3c2f4d9 100644
--- a/assets_src/js/lib/dom.js
+++ b/assets_src/js/lib/dom.js
@@ -17,6 +17,16 @@ export function closest(el, fn) {
17 return null; 17 return null;
18} 18}
19 19
20export function withClass(className) {
21 const els = document.getElementsByClassName(className);
22 const arr = [];
23
24 for (let i = 0; i < els.length; i++) {
25 arr.push(els.item(i));
26 }
27 return arr;
28}
29
20export function next(el, fn) { 30export function next(el, fn) {
21 if (!el) { 31 if (!el) {
22 return null; 32 return null;