Created
December 5, 2014 13:48
-
-
Save celsofabri/11b2389f0df206c2e2e4 to your computer and use it in GitHub Desktop.
Change URL Hash on Scroll / Mudar URL Hash ao deslizar
This file contains hidden or 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
// Change URL Hash on Scroll ======================================= | |
$(document).bind('scroll',function(e){ | |
$('.section-block').each(function(){ | |
if ( $(this).offset().top < window.pageYOffset + 10 && $(this).offset().top + $(this).height() > window.pageYOffset + 10) { | |
window.location.hash = $(this).attr('id'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment