Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Select all links with hashes
- $('a[href*="#"]')
- // Remove links that don't actually link to anything
- .not('[href="#"]')
- .not('[href="#0"]')
- .click(function (e) {
- e.preventDefault();
- var offset = 117;
- var target = this.hash;
- // if ($(this).data('offset') != undefined) offset = $(this).data('offset');
- $('html, body').stop().animate({
- 'scrollTop': $(target).offset().top - offset
- }, 500, 'swing', function() {
- // window.location.hash = target;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement