Comments (15)
Yep, it's planned. Sounds easier than it is (pushstate, onpopstate, etc.).
from skrollr-menu.
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.
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.
This will cause the browser to jump to said hash.
from skrollr-menu.
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.
Tried it in FF and Chrome and it does what I said.
from skrollr-menu.
hmm ok bit odd not doing it on mine have tried a few different computers and IE7+
from skrollr-menu.
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.
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 animates150px
back.
this happens in both Firefox and Chrome on Ubuntu.
from skrollr-menu.
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.
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.
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.
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.
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.
Good stuff, Alex! Well done, and thanks for this.
from skrollr-menu.
Related Issues (20)
- complexLinks not working correctly HOT 1
- skrollr-menu not working on mobile HOT 1
- Skrollr-menu scrolls to same location based on handlelink
- skrollr.menu.click(link) not working HOT 1
- Doesn't work HOT 2
- Scroll or Jump to the position HOT 1
- Hash URLs not loading properly on page load HOT 2
- Add bower.json manifest file HOT 1
- data-menu-offset percentage offset HOT 3
- Wrong version of Minified library in release 1.0.1 HOT 1
- Scrolling is not working, even though everything seems to be configured properly
- Enable Sourcegraph
- Add skrollr-menu to cdnjs.com HOT 1
- No support for require.js HOT 1
- url plus hash not working HOT 2
- problem in mobile device
- /dist/ contains wrong files HOT 1
- Webpage doesn't scroll as in demo when click on navigation links HOT 2
- handleLink buggy on safari iOS
- Hashes always appear in URL
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 skrollr-menu.