jquery - can't seem to get the links to the right heights on the website because my menu is in the way -
i have website fixed menu, , menu links throw user down 1 page content link clicked. because have fixed menu, when click on link in menu , website throws me down, perfect, if menu wasn't in way. is. i'd content start after fixed menu, don't know how done. jquery use links throw user down:
$(document).ready(function(){ $('li a[href^="#"]').on('click',function (e) { e.preventdefault(); var target = this.hash; var $target = $(target); $('html, body').stop().animate({ 'scrolltop': $target.offset().top }, 900, 'swing'); window.location.hash = target; }); }); });
change $target.offset().top
$target.offset().top - 64
account height of fixed menu. adjust needed based on height of menu, or query actual current height of menu in code.
Comments
Post a Comment