Coder Social home page Coder Social logo

Comments (15)

Prinzhorn avatar Prinzhorn commented on August 13, 2024

Yep, it's planned. Sounds easier than it is (pushstate, onpopstate, etc.).

from skrollr-menu.

johnfisherman avatar johnfisherman commented on August 13, 2024

Great, good to know. It is a standard-breaker, thus an important implementation.

That said, huge kudos for both skrollr and the plugin ecosystem!

from skrollr-menu.

nwhite89 avatar nwhite89 commented on August 13, 2024

I had a quick look at this is it not possible to add

window.location.hash = href.substr(1);

after the test to check if it is a hashlink? This fix will only work in IE8+ as far as I am aware so this might not be a viable option?

from skrollr-menu.

Prinzhorn avatar Prinzhorn commented on August 13, 2024

This will cause the browser to jump to said hash.

from skrollr-menu.

nwhite89 avatar nwhite89 commented on August 13, 2024

I have tried it my self and it simply changes without doing anything (tested in chrome and firefox) unless you can think of a browser that this will occur?

from skrollr-menu.

Prinzhorn avatar Prinzhorn commented on August 13, 2024

Tried it in FF and Chrome and it does what I said.

from skrollr-menu.

nwhite89 avatar nwhite89 commented on August 13, 2024

hmm ok bit odd not doing it on mine have tried a few different computers and IE7+

from skrollr-menu.

mcmedia79 avatar mcmedia79 commented on August 13, 2024

I've added the window.location.hash = href.substr(1); in the handleClick function and it works fine in almost all browsers except mobile safari... Well at least the back button on mobile works fine but no animation.

A mix between scroll.menu and this library would be awesome
http://benalman.com/projects/jquery-bbq-plugin/

By the way, great job on skrollr!

from skrollr-menu.

Prinzhorn avatar Prinzhorn commented on August 13, 2024

I've added it to this line https://github.com/Prinzhorn/skrollr-menu/blob/master/src/skrollr.menu.js#L62 and the following happens when I try it

  • clicking on #awesome jumps to it without animation
  • clicking on 150px before #wambo jumps to #wambo and then animates 150px back.

this happens in both Firefox and Chrome on Ubuntu.

from skrollr-menu.

mcmedia79 avatar mcmedia79 commented on August 13, 2024

Forgot to tell, i'm only using data-menu-top instead of anchors nav.
Works better with my skrollr animation.

This way I have an anchor that works with the back button and animation that gets right where i want.
But the back button doesn't anime on safari mobile.

from skrollr-menu.

nwhite89 avatar nwhite89 commented on August 13, 2024

I have done some further looking into this, when my items are easing in from the side it doesn't jump however, when scrolling downwards it does. seems very odd why to me personally

from skrollr-menu.

DarekC avatar DarekC commented on August 13, 2024

Hi
This seems to be great enhancement.
Isn't it as simple as adding just line after var scrollTarget = document.getElementById(href.substr(1)); ?

window.history.pushState(href, scrollTarget, href);

For modern browsers i assume.
Or it's lack something a can't see? Which is possible - i'm a beginner.

from skrollr-menu.

Prinzhorn avatar Prinzhorn commented on August 13, 2024

For modern browsers i assume.
Or it's lack something a can't see? Which is possible - i'm a beginner.

On first sight it might look like it's that simple (it's not that hard either).

But

  • You need to listen for popstate in order to scroll to the correct position when the user uses the back button
  • When the page initially loads, we need to handle the hash as well (jump to the right position without animation). Right now we don't (we just prevent that the hash does anything).

from skrollr-menu.

Prinzhorn avatar Prinzhorn commented on August 13, 2024

Was finally trying to get this implemented, but http://stackoverflow.com/questions/10742422/prevent-browser-scroll-on-html5-history-popstate

So basically it won't work the way I wanted it to.

from skrollr-menu.

johnfisherman avatar johnfisherman commented on August 13, 2024

Good stuff, Alex! Well done, and thanks for this.

from skrollr-menu.

Related Issues (20)

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.