문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top