WeCodePixels / theia-sticky-sidebar

Glues your website's sidebars, making them permanently visible while scrolling.
MIT License
570 stars 209 forks source link

[Question] Vanilla JS alternative? #63

Open willstocks opened 5 years ago

willstocks commented 5 years ago

Hello! Let me start by saying - great script/library! Super duper duper useful - thank you so much. Question for you: Why the dependency on jQuery? Would a vanilla JS version be something you'd consider in the future? Plain Javascript is now on-part with jQuery in terms of features, and has the potential to even outperform - not only that, but it'd also alleviate some people having to load jQuery!

liviucmg commented 5 years ago

Hi Will, thank you for the kind words. :) The library was started a long time ago when jQuery was the obvious choice, at least for me. But you are right, it would make sense to remove jQuery entirely as a dependency, maybe even throw in ES6 while we're at it and also provide a minified+polyfill version.

willstocks commented 5 years ago

Hey Liviu!

That would definitely be an interesting thing to see!

Making use of things like IntersectionObserver as well, for maximum scrolling performance?

I’d be truly interested in that - especially with the general internet migration to native rather than dependencies!

I’ve been trying to go as native as possible where I can, as well as only polyfill when absolutely necessary (I have a little script I built out) - I’d be super interested in seeing a vanilla variant of this (hit me up if you want a beta tester!!!)! 👍🏻👍🏻👍🏻

On Wed, 27 Feb 2019 at 17:36, Liviu Cristian Mirea-Ghiban < notifications@github.com> wrote:

Hi Will, thank you for the kind words. :) The library was started a long time ago when jQuery was the obvious choice, at least for me. But you are right, it would make sense to remove jQuery entirely as a dependency, maybe even throw in ES6 while we're at it and also provide a minified+polyfill version.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WeCodePixels/theia-sticky-sidebar/issues/63#issuecomment-467957405, or mute the thread https://github.com/notifications/unsubscribe-auth/Apt9AtDtyYYkGU_WwwUxVwVOVxT4qoJeks5vRsIGgaJpZM4bPu4j .

Nincha commented 2 years ago

Hi!

I'm also highly interested in this topic. :D

As Jquery was dropped off the project I had to replace your library with a plain and simple position sticky ; but that makes parts of the sidebar invisible unless your scroll to the end of the page (which can be a pain if you also use ajax loaded content on scroll on the main section).

Cheers anyway for the great work so far!