Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function smoothInlineScroll() {
- $("nav #menu a").bind('click', function(e) {
- isScrolling = true;
- var id = $(this).attr('href').substr(1);
- var index;
- //TODO: Create a function for this
- $.each(section, function(key, val) {
- if(val['id'] == id) {
- index = key;
- return;
- }
- });
- $("body").animate({scrollTop: section[index].staticOffset - headerHeight}, 1000, animationType, function() {
- isScrolling = false;
- currentSection = index;
- });
- e.preventDefault();
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement