Прошу прощения, если на вопрос был дан ответ. Это код, на который я ссылаюсь. Но у меня проблемы с его использованием. Я все еще новичок в jQuery. Большое спасибо за помощь
jQuery(document).ready(function($){
var aboutNav = $('.about-nav'),
aboutNavTopPosition = aboutNav.offset().top,
taglineOffesetTop = $('#intro-tagline').offset().top + $('#intro-tagline').height() + parseInt($('#intro-tagline').css('paddingTop').replace('px', '')),
contentSections = $('.section');
$(window).on('scroll', function(){
//on desktop - assign a position fixed to logo and action button and move them outside the viewport
( $(window).scrollTop() > taglineOffesetTop ) ? $('#logo, .btn').addClass('is-hidden') : $('#logo, .btn').removeClass('is-hidden');
//on desktop - fix about navigation on scrolling
if($(window).scrollTop() > aboutNavTopPosition ) {
//fix about navigation
aboutNav.addClass('is-fixed');
//push the .main-content giving it a top-margin
$('.main-content').addClass('has-top-margin');
//on Firefox CSS transition/animation fails when parent element changes position attribute
//so we to change about navigation childrens attributes after having changed its position value
setTimeout(function() {
aboutNav.addClass('animate-children');
$('#logo').addClass('slide-in');
$('.btn').addClass('slide-in');
}, 50);
} else {
aboutNav.removeClass('is-fixed');
$('.main-content').removeClass('has-top-margin');
setTimeout(function() {
aboutNav.removeClass('animate-children');
$('#logo').removeClass('slide-in');
$('.btn').removeClass('slide-in');
}, 50);
}
//on desktop - update the active link in the about fixed navigation
updateaboutNavigation();
});
//smooth scrolling when clicking on the about navigation items
aboutNav.find('ul a').on('click', function(event){
event.preventDefault();
var target= $(this.hash);
$('body,html').animate({
'scrollTop': target.offset().top - aboutNav.height() + 1
}, 400
);
//on mobile - close about navigation
$('.about-nav-trigger').removeClass('menu-is-open');
aboutNav.find('ul').removeClass('is-visible');
});
});
Моя проблема в том, что код для бокового меню с наклейками внизу не работает, потому что вторая строка кода
aboutNavTopPosition = aboutNav.offset().top,
Я заменил его. но все еще безуспешно.