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.28k stars 7.29k forks source link

Question: how to deactivate parallax effect on mobile please? #4570

Closed E-Baler closed 1 year ago

E-Baler commented 1 year ago

Hello,

I'm having a little problem with fullpage and elementor.

I deactivated fullpage from 500 px (so just for mobiles). This works without a problem, but the parallax plugin of fullpage continues to work on background images and this destructures the site.

My question is: is it possible to disable plugins (parallax) like fullpage.js depending on the viewport please?

Thank you!!!

alvarotrigo commented 1 year ago

My question is: is it possible to disable plugins (parallax) like fullpage.js depending on the viewport please?

Sure, use the destroy method under your custom conditions using callbacks like afterResponsive or afterResize.

https://github.com/alvarotrigo/fullPage.js/wiki/Extension---Parallax#destroy

fullpage_api.parallax.destroy();
E-Baler commented 1 year ago

Ok thanks a lot !!!!

vxsilis commented 2 months ago

how did u deactivated fullpage on specific px ?

alvarotrigo commented 2 months ago

how did u deactivated fullpage on specific px ?

You can use the destroy function for that.

Something like this:

new fullPage('#fullpage', {
    responsiveWidth: 900,
    afterResponsive: function(isResponsive){
        if(isResponsive){
             fullpage_api.parallax.destroy();
        }
        else{
            fullpage_api.parallax.init();
         }
     }
});