cmpolis/scrollIt.js

Anchor Link in url string

Closed this issue · 2 comments

Hi.

Is it possible to append an anchor link to the url when reaching each section?

Yup, this could be done with the onPageChange callback function

For future readers:

  $.scrollIt({
      onPageChange: function(index)
      {
          var anchor = $("[data-scroll-nav='"+index+"']").attr("href");
          if(anchor && anchor != "#")
          {
              location.hash = anchor;
          }
      }
  });