Finsweet anchor system not working properly

Viewed 116

The issue:

When in click on an anchor tag, the webpage doesn't scroll properly to the id specified in the href. The page scroll before or after the div containing the id used by the href.

This is the code I use on my template.

<script>
// immediately/self invoked function. This function executes right away
(function() {
// create a new Library instance and store it in a variable called "fsComponent"
var fsComponent = new FsLibrary('.cours') // Collection List class

// // run nest on your instance
fsComponent.nest({
  textList: '.text-of-categories-list', // plaintext comma separated list
  nestSource: '.nest-multi-reference', // CMS list we are taking real tags from
  nestTarget: '.multi-ref-target' // where we paste the items from nestSource
})
// run Anchor component on our instance
fsComponent.anchor({
  anchorButton: '.ancre_cours', // button used to scroll through anchor sections
  anchorId: '.anchor-url-and-section-id', // button href and section id
  buttonsTarget: '.ancre_menu', // where we will 'paste' the anchor buttons
  activeClass: "active-link", // active state for anchor scrolling buttons
})
})();
</script>

Regards.

0 Answers
Related