Last active
November 6, 2020 05:05
-
-
Save iamravenous/4a1545dc3ccd24abf89e to your computer and use it in GitHub Desktop.
Hash change on scroll with Bootstrap 3 Scrollspy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Scrollspy Hashchange | |
* Hash change on scroll with Bootstrap 3 Scrollspy | |
* Author: Franco Moya - @iamravenous | |
*/ | |
$(window).on('activate.bs.scrollspy', function (e) { | |
history.replaceState({}, "", $("a[href^='#']", e.target).attr("href")); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment