Comments (3)
Sounds great! I'll try and add that and create a PR.
from scroll-plugin.
I've actually created a fork with an option like this. We could think about merging those changes, I just never came around to creating a PR.
from scroll-plugin.
Nice! I just had a look at the related commit. I like it, but the current solution would be a breaking change in the API, since animateScroll
is being removed from the options. Maybe a solution could be to use an optional object instead, like described above? Using your naming it could look like this:
const swup = new Swup({
// ...
plugins: [
new SwupScrollPlugin({
animateScroll: {
betweenPages: false,
onSamePage: true
},
}),
]
});
That way, we could make the old option still work if it's just a boolean, and set all object properties accordingly:
const swup = new Swup({
// ...
plugins: [
new SwupScrollPlugin({
animateScroll: true // or false
}),
]
});
// ...could internally be transformed to:
animateScroll: {
betweenPages: true,
onSamePage: true
}
from scroll-plugin.
Related Issues (15)
- animateScroll doesn't seem to work HOT 6
- Scrolls to incorrect position on Firefox when using anchor link HOT 2
- Feature Idea: Restore overflowing div's scroll position on popstate HOT 14
- Disable smooth scroll for certain links HOT 11
- `swup.scrollTo()` method needs review HOT 4
- Scroll control of elements on page HOT 3
- Add `ignore` option HOT 11
- Emulate `:target` to allow styling anchor element
- Make `shouldResetScrollPosition` work for non-link requests HOT 1
- Back button scroll restoration not working HOT 19
- A11y: allow disabling animated scroll from visit object HOT 1
- Scroll options not applied correctly HOT 1
- I'm not even sure if this is a issue, but I need help HOT 1
- [Bug]: Visit object `visit.from.url` and `visit.to.url` values incorrect on `scroll:end` lifecycle HOT 5
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 scroll-plugin.