Comments (9)
v1.0 is just released! Could you check if this issue still exists? Please note that the API has changed quite a bit.
from scrolltrigger.
The scroll-showCallback can now be set either as a global callback, e.g. triggering by default on all triggers, or when adding a certain set of triggers;
Global / default callback
const scrollTrigger = new ScrollTrigger({
trigger: {
toggle: {
callback: {
in: () => {
// This is the same as setting a data-scroll-showCallback
alert('in')
},
out: () => {
// This is the same as setting a data-scroll-hideCallback
alert('out')
}
}
}
}
})
scrollTrigger.add('[data-scroll]')
Only for certain triggers
const trigger = new ScrollTrigger()
// Add simple triggers, without callback
trigger.add('[data-scroll]')
// Add triggers to the ScrollTrigger, only with attribute `data-scrollWithCallback`
trigger.add('[data-scrollWithCallback]', {
toggle: {
callback: {
in: () => {
alert('in')
},
out: () => {
alert('out')
}
}
}
})
Adding some documentation for upgrading from 0.x to 1.x sounds like a good idea, i'll add that to the roadmap.
from scrolltrigger.
Added documentation on migrating from 0.x
from scrolltrigger.
I have the same problem
from scrolltrigger.
v1.0 is coming soon, this will fix this issue. I'm still working on it, but quite busy at the moment. I would love to support Vue.js and React out of the box, this still takes some work; but the 'basic' idea works perfectly.
If you are brave you can already use the current draft of 1.0 @ https://github.com/terwanerik/ScrollTrigger/tree/v1.0
from scrolltrigger.
I have the same problem. Is v1.0 around the corner? I don't mean to rush you, if it is farther off I will try and build my own, as you suggested. Thanks for the library btw.
from scrolltrigger.
I tried the v1.0 draft and it doesn't seem to work too. Any indications to try to fix this?
from scrolltrigger.
Updated the codepen to use v1.0.0, now works as expected.
https://codepen.io/erikterwan/pen/qBBMVXQ
from scrolltrigger.
Hmm, I'm not sure how to map my old config to the new API... I have various data-scroll-showCallback
in my html file, where do I put these for the new API? Maybe this should be documented in more detail and specifically for switching versions...
from scrolltrigger.
Related Issues (20)
- typescript support
- critical vulnerabilities in object-extend dependancy HOT 1
- IOS Safari is not smooth
- horizontal scroll not working<eom> HOT 3
- Not compatible with safari HOT 6
- Elements slightly out of window not firing HOT 5
- Elements with negative offset invisible on first load if at top of viewport HOT 2
- mobile views HOT 2
- The visibility check on Microsoft Edge is always true HOT 1
- scroll does not into correct position HOT 1
- overflow-y: scroll multi browser issues (doesn't show\animate) HOT 1
- Responsive offset HOT 1
- Halt autoplay interval when carousel isnβt within the viewport HOT 1
- Add settings inline with [data-trigger]? HOT 1
- Bootstrap compatibility HOT 2
- explorer error HOT 3
- Can an on-screen element trigger an off-screen element? HOT 2
- Triggers not firing with css scroll-snap
- Locomotivescroll
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 scrolltrigger.