Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function menuScroll(href) {
- var hrefArr = href.split('#');
- if (hrefArr.length == 2) {
- if ($('#' + hrefArr[1]).offset()) {
- $("body, html").animate({
- scrollTop : $('#' + hrefArr[1]).offset().top - 150
- }, 800);
- return false;
- }
- }
- return true;
- }
- menuScroll(window.location.href);
- $('.nav li a').click(function() {
- return menuScroll($(this).attr('href'));
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement