Offset from the body on click jquery?

Hi all!
There is code which performs scrolling when you took out but on my site the menu is fixed, when clicking on the menu item hides the header. The question is how to make that when pressing the padding were with body,and another block.
Now it looks like the header by clicking on the letter a (that is, when pressing And shows the letter B for the menu And hid)

 $("#menu").on("click","a", function (event) {
 //cancel default processing for clicking the link

 //taking the ID side with href attribute
 var id = $(this).attr('href'),

 //find out the height from the beginning page of the block referenced by the anchor
 top = $(id).offset().top;

 //use the transition to distance - top for 1500 MS
 $('body,html').animate({scrollTop: top}, 1500);
July 4th 19 at 23:01
0 answer

Find more questions by tags jQuery