Giter Club home page Giter Club logo

Comments (5)

hsnaydd avatar hsnaydd commented on September 3, 2024

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.

pepelsbey avatar pepelsbey commented on September 3, 2024

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.

hsnaydd avatar hsnaydd commented on September 3, 2024

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.

hackuun avatar hackuun commented on September 3, 2024

@hsnaydd please add example that keeps anchors, this feature is must-have, and I don't know History API.

from moveto.

amadeann avatar amadeann commented on September 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.