Home › Forums › CSS › Fadein animations and anchor links › Reply To: Fadein animations and anchor links
March 22, 2016 at 1:17 pm
#239704
Shikkediel
Participant
Ah, looks like the sticky menu is added after the script is executed so these links aren’t included. A solution could be to use a delegated event :
$(document).on('click', 'a[href*="#"]:not([href="#"])', function() {
Instead of :
$('a[href*="#"]:not([href="#"])').click(function() {
If you’d like to keep a bit of space between the header and the point to which is being scrolled, you could just subtract a few pixels :
scrollTop: target.offset().top-$('.isStuck').height()-10