Search code examples
jqueryfullpage.jstitlebarsectionspage-title

Fullpage.js: Change page title based on current section


As the Title of this post already says, how to change the page title based on the the current section in Fullpage.js?


Solution

  • Fullpage.js has an event onLeave.

     onLeave: function(index, nextIndex, direction){ 
         switch(nextIndex) {
             case 1:
                 document.title = "Index";
                 break;
             //etc
         }
     },
    

    Maybe something like this will do