alvarotrigo / fullPage.js

fullPage plugin by Alvaro Trigo. Create full screen pages fast and simple
http://alvarotrigo.com/fullPage/
GNU General Public License v3.0
35.27k stars 7.3k forks source link

slider interferes with external links load #2005

Closed andrea-86 closed 8 years ago

andrea-86 commented 8 years ago

probably I am I missing some step but I have a problem with the external link load in the section where I have a slider. When you click on the external link, if the page(section) switches to the next slide (with a corresponding URLs change, eg: http://mydomain.com/main.asp#firstPage change in http://mydomain.com/main.asp#firstPage/1) the outer page loading is interrupted. Is there a way to prevent this, such by stopping the slider when I click on the link, so the page is redirected properly?

Thanks

alvarotrigo commented 8 years ago

Please be more specific and add an isolated reproduction in jsfiddle or codepen as detailed in the reporting issues guidelines.

I can't understand your problem.

andrea-86 commented 8 years ago

i can't reproduce that on fiddle because link to external page dosn't work there.

anyway, i think i solved the problem adding a clerInterval for the slider, like this:

var slideTimeout;
$('#fullpage').fullpage({
...
afterRender: function () {
                //on page load, start the slideshow
                slideTimeout = setInterval(function () {
                    $.fn.fullpage.moveSlideRight();
                }, 5000);

                $("a.external-link").on("click",function(){
                    clearInterval(slideTimeout);//prevent slide moving so external link can goes to external page
                });

            },
...
});
alvarotrigo commented 8 years ago

I'll close the issue then.