FullPage scroll AND change background colour on scroll

Hi Webflow,

I am have got FullPage scroll working (fullPage.js | One Page Scroll sections Site Plugin) and I have got the background to change colour as I scroll.

However, they do not work in tandem. I think it would be sweet if they did.

The background is a 100vh 100vw fixed div with a negative z-index and it changes colour using IX2.0.

The fullPage scroll is set up - currently commented out the custom code above the tag.

So at this point the background colour works but not the scroll. If you uncomment out the code the fullPage scroll will work but the colour does not change. Frustrating.

Can anyone be a hero and shed some light?

Share link below. BE AWARE: Iā€™m working on the page called ā€˜Home 2ā€™.

Published site here: http://twoupdigital.webflow.io/home-2

Rob


Here is my site Read-Only: LINK

I canā€™t publish to actually test it but try:

Removing the height of ā€œBackground Colorā€
Removing the position so it is no longer fixed
Putting the Full Page Wrap div inside of the Background Color div

Like this:
9a04c4ccabc2fcc1c7d8081528b560bf

14c8efc89a0de033bdc301738a10d993

Hi @PHRyan,

Thanks for your help. I tried that and itā€™s causing the fullPage scroll to not work.
https://www.twoupdigital.com/home-2

There must be a conflict of some sorts somewhere. Any other suggestions?

Thanks

Rob

Have you tried changing what the scroll action affects from ā€œBackground Colourā€ to the ā€œFull Pageā€ div?

Like this:

@roblewi5 While fullpage.js is easy to implement, I constantly run into issues like this. There is a known issue with FP.JS interfering with scroll interactions. You cannot apply interactions directly to the fullpage or section divs.

What Iā€™ve done as a work around is to put another div inside of the section and have it fill the w and h of the section. You should be able to interact with this new div or elements inside of it.

So in your case, instead of changing the background color of a single element with the scroll trigger, try having the scroll trigger fade between different colored bkgd fixed divs inside each sectionā€™s new inner div. Adjust the timing on the opacity fade to hopefully get close to a ā€œwhile scrolling triggerā€.

Let me know if that helps or if you have further questions.

2 Likes

Super good to know! Hopefully there will be changes to that in the future :crossed_fingers:

Hi mate.

I tried that previously but set the Full Page Wrap height to 100vh and position to fixed.

I tried again and it didnā€™t work. Annoyingly, i canā€™t get the fullPage scroll to work at all now so itā€™s hard to say whether this didnā€™t work or not.

Rob

1 Like

Hi @matthewpmunger,

Thanks for the information! Once I get fullPage scrolling working again Iā€™ll give your technique a go and let you know how i get on.

Rob

1 Like

Got scroll working again. Unfortunately, changing the BG Colour on the Full Page Wrap didnā€™t work. It lost colour after the first scroll.

Thanks for the idea.

Rob

1 Like

Hi @matthewpmunger,

I understand what youā€™re saying but I canā€™t get it to work. Iā€™ve tried using a While Scrolling In View element trigger to get the opacity of the Sectionsā€™ fixed Background Colour Div to fade as scroll out.

Just have strange results. I.e. the next sectionā€™s Background Colour Div is misaligned and thereā€™s no opacity fade at all. https://www.twoupdigital.com/home-2

Unless iā€™m doing this wrong (please suggest a better technique if so) or just have to resign that fullPage affects the scrolls triggers too much.

Rob

Would you mind making the project cloneable so I can copy and paste your setup into my own project and play around with it? That way I could publish and test on my own site. If you donā€™t want to I totally understand!

Hi mate,

Sure itā€™s here: https://webflow.com/website/twoupdigital

I have removed the interaction unfortunately but itā€™s quick to re-do. Be awesome if we can work this out.

Please let me know when itā€™s copied and iā€™ll take it off showcase as itā€™s for the company I work for.

Rob

Still not working right for me. Finding issues with each thing I try.

Itā€™s frustrating as thereā€™s potential for some amazing effects.
Thereā€™s another jquery one here: jQuery Scrollify - Power steering for your scroll wheel
Maybe doesnā€™t effect the IX2.0 scroll interactions as much.
Appreciate your efforts!
Rob

Alright Iā€™ve cloned it. Iā€™ll play around and see if I can find anything!

1 Like

@PHRyan @matthewpmunger

May I present this to you chaps:
https://www.twoupdigital.com/home-3

Using Scrollify. Boom :boom:

1 Like

Perfect!! All it took was a different js haha. I would suggest playing with the easing and scroll speed though. I like the smoothness of the fullpage.js more than scrollify. Too snappy you know? But glad you got it man!

Bam! :fist_right: :fist_left:

1 Like

Think you can edit the configuration easy enough. Obviosuly just used the default to get it going.

Scrollify must have cleaner code than fullPage.js using jQuery so less likely to cause conflicts.

Cheers mate and thanks for your help. Hope you can use it in one of your projects.

Fair few hours spent on this today but can now crack open a well-earned beer.

1 Like

Well the problem for fullpage is right in the name, itā€™s a ā€œFull Pageā€. You donā€™t ever actually scroll. If you look on the right there is no scrollbar because the wrapper with the ID fullpage is set to 100vh with overflow: hidden in the script. The scroll trigger doesnā€™t move you down the page it just moves content towards you. Thatā€™s why ā€œWhile scrollingā€ animations donā€™t work, you never actually move :face_with_monocle: But if you look at the scrollify example on home-3 there is a scroll bar meaning the way he made the snap scrolling was with the intent of actually scrolling down the page rather than moving content around your viewport.

Still awesome though!