Tokimon / vanillajs-browser-helpers

Vanilla JS helper methods for in browser usage
MIT License
23 stars 1 forks source link

Clarify installation #44

Open franck-noahk opened 4 years ago

franck-noahk commented 4 years ago

I am having issues getting the module to work. I ran the install code and it installed correctly; however, I can't seem to get the code to work in my browser.

Notification.js ` import inView from 'vanillajs-browser-helpers/es5/inView.js'; //I tried these classes and the es6 varient import addClass from 'vanillajs-browser-helpers/es5/addClass.js'; import removeClass from 'vanillajs-browser-helpers/es5/removeClass.js';

let notification = document.getElementById('notification'); let notificationTrigger = document.getElementById('notification-trigger');

if (notification != null && notificationTrigger != null) {

if (inView(notificationTrigger) != true) {
    removeClass(notification, "visible",);
} else {
    addClass(notification, "visible",);
}

} But when I have` I get an error in the console about relative paths. Maybe it's my limited exposure to javascript or limited understanding of node. But could you build a short sample website to help clarify how to get it running beyond just NPM install?

Tokimon commented 3 years ago

Ok this is strange. Normally you are using the module correctly. I will look into having some interactive demos.