I have a single page with multiple sections. I also have a fixed header bar. When I scroll to each section, I want the section title to display inside the fixed header bar.
I tried this:
$('a.icons').click(function(){
$('html, body').animate({scrollTop: $('section.icons').offset().top - 100}, 300);
$icon = $('.style-menu-icon');
$icon.text(function () {
//change text based on condition
return "Icons";
});
});
This is saying or at least is trying to say:
Click on link icons.
Scroll to section.icons div, offset -100px
return the string "Icons" inside the .style-menu-icon div class