Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // requires jQuery scrolls smoothly to all href ids e.g. <a href="#some_div_id">scroll to div</a>
- $(function() {
- $('a[href*=#]:not([href=#])').click(function() {
- var target = $(this.hash);
- target = target.length ? target : $('[name=' + this.hash.substr(1) +']');
- if (target.length) {
- $('html,body').animate({
- scrollTop: target.offset().top
- }, 1000);
- return false;
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement