electerious / basicScroll

Standalone parallax scrolling for mobile and desktop with CSS variables.
https://basicscroll.electerious.com
MIT License
3.63k stars 148 forks source link

[Feature] Option to set custom "scrolling element" #61

Closed hakimio closed 2 years ago

hakimio commented 2 years ago

There are some cases when "scrolling element" is neither document.scrollingElement, nor document.documentElement. For example, when using web components with shadow root or Ionic framework components which are also built on top of web components. You can check ion-content component to see how it works.

It would be really nice if it was possible to manually specify the "scrolling element" when creating new basicScroll instances.

hakimio commented 2 years ago

@electerious if you are busy, I could make a PR.

electerious commented 2 years ago

I remember that there wasn't a good solution to do so: https://github.com/electerious/basicScroll/issues/10#issuecomment-449143806

But the comment is a few years old. Maybe there's a better way now. I will close this issue, but I'm open for a PR :)