You no longer need to recalculate and update your instances when the window size changes. basicScroll now takes care of it.
1.x
const instance = basicScroll.create({
elem: document.querySelector('.element'),
from: 'top-bottom',
to: 'bottom-top',
props: {
'--opacity': {
from: 0,
to: 1
}
}
})
// Recalculate and update your instance manually when the tracking is disabled.
// Debounce this function in production to avoid unnecessary calculations.
window.onresize = function() {
instance.calculate()
instance.update()
}
Changes
New
track
option to disable window size tracking for each instance individually (#7)Changed
props
callback parameter is now nicely formattedupdate
method returns a nicely formatted object of propsHow to update
Direct mode
Direct mode must now be defined globally per instance instead of setting it on each prop individually.
1.x
2.x
Track window size changes
You no longer need to recalculate and update your instances when the window size changes. basicScroll now takes care of it.
1.x
2.x
Props
The
props
callback parameter is now nicely formatted.1.x
2.x