Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $('#nav li a').click(function(){
- var el = $(this).attr('href');
- var elWrapped = $(el);
- scrollToDiv(elWrapped,40);
- return false;
- });
- function scrollToDiv(element,navheight){
- var offset = element.offset();
- var offsetTop = offset.top;
- var totalScroll = offsetTop - 80 + "px";
- $('body,html').animate({
- scrollTop: totalScroll
- }, 500);
- }
- });
Add Comment
Please, Sign In to add comment