Comments (5)
Hi @pepelsbey
Thank you for suggestion, but I don't think this is a task that this plugin has to do. In my opinion, small plugins like MoveTo should do one job and do it well. You can do the things you mentioned with callback function easly. MoveTo is an extensible plugin, depending on your purpose.
Sory for the late reply 😔
Thank you.
from moveto.
It’s totally doing one job only, but it replaces behaviour that’s doing two jobs: scrolling (or rather jumping) and keeping URL updated. Both important for UX. So you’re downgrading experience instead of enhancing it.
Of course it’s up to you, I’m not demanding anything here. I’m not even your user, I just came around from Rachel Nabors’ tweet to see if it’s good. But then I realized that it doesn’t care enough about web UX and Rachel agreed with me:
Argh, that's a big no go for me!
Hope it'll get fixed! I love anchors, too!
Defaults options are longest to stay, so I expect 99% of users of your library breaking UX with non-updating URLs instead of taking extra mile and figuring out History API in callback. But you can help them with that.
The best possible way to do what you’re trying to achieve here is to enhance experience, e.g keep existing behaviour intact (or mimic it) and make it work better by introducing smooth scrolling instead of immediate jump.
I hope you’ll decide to make moveTo UX even better. Cheers.
from moveto.
Hi @pepelsbey
As I said above I don't think this is a task that this plugin has to do. Actually this is not an anchor scroll plugin. It is a library that you can use while doing it.
It can be added as an example in the future but I do not think It is a good idea to add it to the source code.
Thank you.
from moveto.
@hsnaydd please add example that keeps anchors, this feature is must-have, and I don't know History API.
from moveto.
Here's a simple way to replace add the hash location:
window.moveTo = new MoveTo({
callback: function (target) {
if (target.id !== undefined) {
window.location.replace("#" + target.id);
}
}
});
from moveto.
Related Issues (18)
- Some minifications suggestions HOT 1
- Multiple moveTo triggers doesn't work HOT 1
- Second click moves page on Top HOT 1
- Scroll inner div HOT 1
- Not Working in Firefox HOT 2
- Doesn't use proper browser History HOT 1
- Update polyfill document HOT 1
- Top margin of the first section ignored when scroll to top HOT 7
- Incorrectly looking target HOT 6
- Lazy loading images
- Offset for fixed header HOT 1
- doesnt work in flex div HOT 3
- Can this package support server side ?
- SyntaxError: Unexpected token: punc ()) - version 1.5.2 HOT 1
- demo中的easeFunctions下的easeInQuad有点问题~我不知道是不是我写的有错 HOT 1
- Problem with request animation frame loop HOT 1
- Focus remains on button HOT 8
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 moveto.