-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
detect if the instance created extends or direct instance of Smooth #17
Comments
@baptistebriel something like this |
Awesome, thanks for the hint @Awea ! 👍 |
@baptistebriel np :) Now I wish I can do what I want with this library ! |
Are you having issues with it? Don't hesitate to ask 🙂 |
If I get stuck at some point yeah, thanks ! |
Hi When I extend the Class, index.js line 288
Is this desired behaviour? |
Hi @jghlt, The |
Hello @jghlt, Yes indeed, this is an expected behaviour; when you use an extended version of Smooth, you might want to set Let me know what you think! |
@Awea in the demos it seems to be explicitly set again within the custom.js for each demo. @baptistebriel Cool, its not a big deal to have to set this again, but might be nice to have an option to retain the default functionality, unless I'm thinking about this in the wrong way? |
We could check something like this: if(!this.extends || this.options.keepDefaultBounding) {
const bounding = this.dom.section.getBoundingClientRect()
this.vars.bounding = this.vars.direction === 'vertical' ? bounding.height - (this.vars.native ? 0 : this.vars.height) : bounding.right - (this.vars.native ? 0 : this.vars.width)
} ... but it adds another option, and I thought it would be just simpler to have complete control on the amount of pixels it can scrolls when it's a custom class of smooth-scrolling. |
I agree its better to keep options to a minimum, but I think it would be good to have the option to maintain the default behaviour in this instance, what do you think? |
Currently to extend Smooth in your own file you have to pass an option. I need to know if the instance created extends Smooth or is direct instance of Smooth.
https://github.com/baptistebriel/smooth-scrolling/blob/master/index.js#L17
I've done this so
smooth-scrolling.js
could be used on its own without going into the build process.The text was updated successfully, but these errors were encountered: