origamid/slide-stories

How to initialize/adjust the js for multiple/dynamic stories on the same page?

Closed this issue · 1 comments

Would be nice if the script works for as many stories that are on a single page.

Solved my issue with the following snippet:

var element = document.querySelectorAll('[data-slide]'); if (typeof(element) != 'undefined' && element != null) { Array.from(document.querySelectorAll('[data-slide]')).forEach(el => { new SlideStories(el.getAttribute('data-slide')); }); }