You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thanks for the project because it seems amazing.
The problem I am encountering is that I am not able to create callbacks functions for the scroll.
The example option is in typescript but even if I change it to Plain JS and pass the object as the options, it does not work for me.
I just convert this code into JS and the console.log does not execute before the scrolls
`const scroller = new SweetScroll({
// Stop scrolling case of trigger element that contains the is-disabled class.
before: (offset: Offset, $trigger: Element | null, scroller: SweetScroll): boolean | void => {
console.log('Before!!', offset, scroller);
if ($trigger && $trigger.classList.contains('is-disabled')) {
return false;
}
},
});`
I have search Github for code using the callbacks of the sweet-scroll library without any success.
I hope this does not bother as I feel is more my fault than yours but I am in a complete roadblock.
Thanks for everything in advance!
The text was updated successfully, but these errors were encountered:
Hi tsuyoshiwada,
First of all thanks for the project because it seems amazing.
The problem I am encountering is that I am not able to create callbacks functions for the scroll.
The example option is in typescript but even if I change it to Plain JS and pass the object as the options, it does not work for me.
I just convert this code into JS and the console.log does not execute before the scrolls
`const scroller = new SweetScroll({
// Stop scrolling case of trigger element that contains the
is-disabled
class.before: (offset: Offset, $trigger: Element | null, scroller: SweetScroll): boolean | void => {
console.log('Before!!', offset, scroller);
if ($trigger && $trigger.classList.contains('is-disabled')) {
return false;
}
},
});`
I have search Github for code using the callbacks of the sweet-scroll library without any success.
I hope this does not bother as I feel is more my fault than yours but I am in a complete roadblock.
Thanks for everything in advance!
The text was updated successfully, but these errors were encountered: