Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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