Pergunta

I'm using fullpage.js and I have to set up external links for each of the pages/tabs to be navigated to.

Now my question is, are the pages loaded when navigated to, or at page load, which I want to avoid, I only want to load the pages when I navigate to them.

Foi útil?

Solução

The plugin doesn't do it by itself. You won't find any documentation about it.

If you want to load things on demand you could do it using ajax ($.get or $.post, for example) by using a fullpage callback such as afterLoad.

You could something like this:

$('#fullpage').fullpage({
    afterLoad: function(anchor, index){
        $.get( "ajax/test.html", function( data ) {
            $( ".result" ).html( data );
            alert( "Load was performed." );
        });
    }

});

If you only need to dynamically load background images, then I would recommend you to use CSS styles for it. You can read more about it in this answer in fullpage.js forum.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top