function observerCallback(entries) {
  entries.forEach(entry => {
    const target = $(entry.target);
    let section;
    if (target[0].hasAttribute('input_name')) {
      section = target.attr('input_name');
    } else {
      section = target.attr('id').split('_')[1];
    }
    if (entry.isIntersecting) {
      session.navSelectors[section].css('background-color', 'lightblue');
    } else {
      session.navSelectors[section].css('background-color', '');
    }
  });
}
/**
 * Highlights navigation buttons in the sidebar corresponding to visible
 * sections. Used as a callback function for the IntersectionObserver.
 * @param {!Array<!IntersectionObserverEntry>} entries
 */
Highlights navigation buttons in the sidebar corresponding to visible
sections. Used as a callback function for the IntersectionObserver.
@param {!Array} entries
Highlights navigation buttons in the sidebar corresponding to visible sections . Used as a callback function for the IntersectionObserver . @param { !Array } entries
function observerCallback(entries) {
  entries.forEach(entry => {
    const target = $(entry.target);
    let section;
    if (target[0].hasAttribute('input_name')) {
      section = target.attr('input_name');
    } else {
      section = target.attr('id').split('_')[1];
    }
    if (entry.isIntersecting) {
      session.navSelectors[section].css('background-color', 'lightblue');
    } else {
      session.navSelectors[section].css('background-color', '');
    }
  });
}
function observerCallback ( entries ) { entries . forEach ( entry => { const target = $ ( entry . target ) ; let section ; if ( target [ 0 ] . hasAttribute ( 'input_name' ) ) { section = target . attr ( 'input_name' ) ; } else { section = target . attr ( 'id' ) . split ( '_' ) [ 1 ] ; } if ( entry . isIntersecting ) { session . navSelectors [ section ] . css ( 'background-color' , 'lightblue' ) ; } else { session . navSelectors [ section ] . css ( 'background-color' , '' ) ; } } ) ; }
Highlights navigation buttons in the sidebar corresponding to visible
 sections.
Highlights navigation buttons in the sidebar corresponding to visible sections .