vanillajs-browser-helpers icon indicating copy to clipboard operation
vanillajs-browser-helpers copied to clipboard

Clarify installation

Open franck-noahk opened this issue 4 years ago • 1 comments

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<Script src="notification.js" type="module"> ` 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?

franck-noahk avatar Jul 31 '20 19:07 franck-noahk

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

Tokimon avatar Nov 22 '20 23:11 Tokimon