Skip to content

Instantly share code, notes, and snippets.

@iamravenous
Last active November 6, 2020 05:05
Hash change on scroll with Bootstrap 3 Scrollspy
/*
* 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