Advertisement
Guest User

scrollTo

a guest
Nov 26th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. function scrollTo($link, e) {
  2. var hash = $link.prop("hash");
  3.  
  4. if (hash && $(hash).length > 0) {
  5. e.preventDefault();
  6. $.scrollTo($(hash), 2000, {
  7. 'axis': 'y',
  8. 'onAfter': function() {
  9. window.location.hash = hash;
  10. }
  11. });
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement