Thursday, 15 April 2010

html - Jquery Scroll to Top + Offset it so it doesn't go under my menu -



html - Jquery Scroll to Top + Offset it so it doesn't go under my menu -

this have

$('.option-heading, .speaker_container').click(function(){ $('html,body').animate({scrolltop: $(this).offset().top}, 'slow'); });

it works, scrolls top , force top of new div under menu. need margin downwards 62px; how do that?

try this:

$('html,body').animate({scrolltop: ($(this).offset().top + 62)}, 'slow');

jquery html css scrolltop

No comments:

Post a Comment