alexiscolin / smooth-scrollr

đź–±Simple smooth scrolling in JS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use without bundler

fluxxus opened this issue · comments

commented

Hey,

I see in the docs that your library could be used via old school script tags, but I am having trouble making it work.

It seems that SmoothScrollr is properly initialised, but no effect whatsoever. No transforms applied to any of the elements etc.

This is what I get if I log the instance in console(I can expand the object if you need more info).

Screenshot 2021-10-01 at 15 55 34

Am I missing something really obvious?

Hi there,

I have tried to run the lib without bundler and it works well.

Have you set the minimal requirede css in order to block the regular scroll. At least you need overflow: hidden and height: 100% (or wathever to size a container height as 100% of the viewport size) on the container and overscroll-behavior: none or overflow: hidden on the body. It's written on the doc but maybe not in the right place to be easely seen.

In addition, I just push a "vertical-inlinescript.html" file in the demos folder in order to show how to use the "old school script tag" ;)

Hope it will help.

commented

Hi,

Thanks for the response and especially for the inline demo you added!

I will cross-check it with my implementation, but obviously I was doing something wrong :)

Thx again