Skip to content

Instantly share code, notes, and snippets.

@kkm
Created October 6, 2016 20:42
Show Gist options
  • Save kkm/7caea0f4ee43e81d2df87b9829f2bdd9 to your computer and use it in GitHub Desktop.
Save kkm/7caea0f4ee43e81d2df87b9829f2bdd9 to your computer and use it in GitHub Desktop.
var scrollToHash = function(hash, time) {
hash = hash || window.location.hash;
time = time || 1000;
k = Meteor.setInterval(function() {
try {
clearInterval(k);
console.log("XW", hash);
$('html,body').animate({
scrollTop : $(hash).offset().top
}, time);
} catch (err) {
}
}, 200);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment