Scrollmagic GSAP

After each screen changes, background colour should change . I mean back-ground colour of thr images should changes. Using TimelineMax how to see change that.

Please see the site here : https://dhiraj10111995.github.io/scroll_screen/

Hi @dhiraj0641, this could be done using setClassToggle() – e.g.

/* Better avoid ID selectors though
as they  have a very high specifity */
#phone-floater-container.scene-02 {
  background: blue;
}

#phone-floater-container.scene-03 {
  background: red;
}
new ScrollMagic.Scene({
  triggerElement: '#phone-floater-container',
  triggerHook: 0,
  offset: 450,
  duration: '0'
})
  .setTween(getMobileSlide02Tl())
  .setClassToggle('#phone-floater-container', 'scene-02')
  .addIndicators()
  .addTo(controller)

new ScrollMagic.Scene({
  triggerElement: '#phone-floater-container',
  triggerHook: 0,
  offset: 1250,
  duration: '0'
})
  .setTween(getMobileSlide03Tl())
  .setClassToggle('#phone-floater-container', 'scene-03')
  .addIndicators()
  .addTo(controller)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.