Jump to content
Search Community

asteroidtoastnetwork

Members
  • Posts

    6
  • Joined

  • Last visited

Community Answers

  1. asteroidtoastnetwork's post in My horizontal infinite image slider with different widths is messed up. was marked as the answer   
    Hello @GreenSock thank you for your reply and for making things cooler since Flash
     
    I've found a way to fix my code, images are now placed correctly:
    const dispose = (scroll) => { gsap.set($items, { x: (i) => { const sumWidth = Array.from($items).slice(0, i).reduce((acc, item) => acc + item.clientWidth, 0); return sumWidth + scroll; }, modifiers: { x: (x, target) => { const currentIndex = Array.from($items).indexOf(target); const s = gsap.utils.wrap(-$items[currentIndex].clientWidth, wrapWidth - $items[currentIndex].clientWidth, parseInt(x)); return `${s}px`; }, }, }); }; dispose(0)  
    I've checked a few console.logs and indeed this code seems do be running a bunch of stuff for nothing.
    I didn't know about the consulting services, I might reach out then.

    Thank you all
×
×
  • Create New...