Comments (5)
@aFarkas You are right, I assumed scroll
was preventable, apparently it's only touch and wheel events. However if you don't mind, that bomb is more than welcome.
Even then, it's not a misunderstanding on my part. It was due to partially missing knowledge.
from stickybits.
Thx, @anilanar. I just answered this stackoverflow question which I found after looking how many people are using this technique.
Checkout the rAF
part. Because you are using the non useful pattern there too. (It's also related to this one).
By the way you need to update getBoundingClientRect
from time to time otherwise it can't react to other layout change like scripted widgets that influences height of the document or window resize...
from stickybits.
@anilanar, I did not know about the passive
property but the pr looks
from stickybits.
Using the passive
event option for the scroll
event doesn't make much sense. If used in conjunction with scroll
event it only shows some basic misunderstanding of the devs writing the code.
happy to drop some knowledge bombs about scroll
, passive
and stuff if you want.
from stickybits.
@aFarkas thanks for your insights.
from stickybits.
Related Issues (20)
- Sticky useStickyClasses odd behaviour HOT 8
- Position: fixed set on a sticky element early if scrollEl is used HOT 2
- Question: Add class with jquery to other element upon stick? HOT 1
- Initial position stuck? HOT 1
- An in-range update of eslint is breaking the build 🚨 HOT 1
- How to use it in Hype HOT 1
- Override class and style application to manually control how they are applied HOT 1
- Angular example doesn't work with useFixed set to true HOT 1
- Using stickybits.js with webpack 4 HOT 1
- Use
- IE11 Issue HOT 3
- An in-range update of eslint-plugin-import is breaking the build 🚨 HOT 2
- Stickybits should not add `position:absolute` after scrolling.
- Position absolute update breaks functionality HOT 8
- `noStyles` no longer applying `position` style attributes
- An in-range update of husky is breaking the build 🚨 HOT 2
- Update method not computing scroll offsets
- empty style tag not removed from head on initialisation
- When "stuck" table headers are shifted one pixel to the right HOT 3
- Remove bottom position when element stuck to bottom
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stickybits.