-
Notifications
You must be signed in to change notification settings - Fork 502
Changing url on scroll [SOLVED] #115
Comments
Exactly what I asked before. Thanks! |
@Rechtsamwald Thanks for this solution. When I implemented your code, the hash did update. But now I've got an annoying jumpy effect when the hash updates (in each browser). Don't you have this? |
@Freekbron, me too. I think this is because browser tries to jump to the anchor. Has anyone a solution? |
Maybe something like this?
|
@ixlipixli, this way is not need use the attr data:
Work IE10+ (and other browsers) To work in IE9, replace this
to
|
Lol im confused. Is there a complete js example that I can just copy and paste? |
Please add the following code on scrollChange event: Here is the default initialisation with the above line added:
|
Added a command changing the url on scroll. It's adding the name (the id) of the current focused section to the url each time you scroll. Since several people seem to need it, it could be adjusted in future versions.
In this part:
just add the following lines:
// ADD THIS TWO LINES TO CHANGE THE URL ON SCROLL !
var theHash = position;
window.location.hash = theHash;
Best regards,
Rechtsamwald
The text was updated successfully, but these errors were encountered: