Skip to content Skip to sidebar Skip to footer

Remove Hash In Url (fullpage.js)

I'm using the plugin fullpage.js Instead of hash urls for the sections like example.com/#sectionname), I would like clean URLs like example.com/sectionname. The plugin doesn't prov

Solution 1:

You can always make use of the HTML 5 history API. You can use callbacks such as onLeave or afterLoad for that:

$('#fullpage').fullpage({
    afterLoad: function(anchorLink, index) {
        history.pushState(null, null, "bar.html");
    }
});

Take into account you'll need to use some polyfill for old browsers. Or just use history.js directly.

Note the example above might not work on localhost on some browsers. You'd better try it in a server.

Post a Comment for "Remove Hash In Url (fullpage.js)"