Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If your target element does not have an ID, and you're linking to it by its name, use this:
- $('a').click(function(){
- $('html, body').animate({
- scrollTop: $('[name="' + $.attr(this, 'href').substr(1) + '"]').offset().top
- }, 500);
- return false;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement