Jump to content
Search Community

Oskars

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by Oskars

  1. I have block with switchable tabs where is multiple scrolltrigger animations, when I am switching tabs i kill all scroll effects and rerun them, becouse on tabs switch is hardly changing html where need scrolltrigger animations. My custom scrolltrigger functions is working, but built in .effects() function works only on first tabs switch. If i am changing tabs more than one time, data-speed effects isnt working. let smoothScroll let smoothScrollParams = { normalizeScroll: true, smooth: 1.5, effects: true } export function smoothScrollCreate(){ smoothScroll = ScrollSmoother.create(smoothScrollParams); } export function killAllScrollEffects(){ ScrollTrigger.killAll() } export function reInitSmootherEffects(){ smoothScroll.effects("[data-speed]") } $('.js-tab').click(function (){ let tab = $(this).data('tab-id') activeType = $('.' + tab) killAllScrollEffects() $('.js-key-to-uniqueness-container').hide() activeType.show() setTimeout(function () { updateSmoothScroll() smoothScrollTo('.js-types-block') initActiveTabScrolltriggers() // run all custom scrolltrigger animations reInitSmootherEffects() // this is working only on frist tabs change }, 400) })
×
×
  • Create New...