Jump to content
Search Community

vrielsdenies

Premium
  • Posts

    9
  • Joined

  • Last visited

Posts posted by vrielsdenies

  1. Hello,

     

    I'm using scrollTrigger to let a little paper plane fly over the screen. It works nice, but when the plane reaches the right side of the page, it should fly out of sight and not come back until scrolling back. But know when you keep scrolling down, the plane already returns :-) You can see it happen when the screen size is not too high. Is there to make the plane just when it leaves the page on the right side? 


    See 

     

    Many thanks! 

    See the Pen vYzwGBM by Vrielsdenies (@Vrielsdenies) on CodePen

  2. Hello,

     

    Thanks for the awesome plugin, I really enjoy working with GSAP! 

    I'm trying to animate a stroke and to keep the arrow in view, like in the middle of the page. But at the moment the arrow goes too quick and moves out of sight very quickly, see the codepen demo. I was wondering if it's possible to keep the arrow in view while scrolling down. 

    Many thanks for your help! 

     

    Kind regards,
    Niels

    See the Pen QWmKyRy by Vrielsdenies (@Vrielsdenies) on CodePen

  3. Thanks guys for your help. What I found out was the case, that if you started dragging on the square, everything went fine. But when you started dragging on the text on the square, the error occurred. I have changed this now and it seems to work :-)

    • Like 2
  4. hi iDad5, It took a little longer, but it's getting there thanks to your help so far :-)

    See 

     

    It's working now and then, but not all the time, and I'm not sure if I made a mistake in gsap, or if it's just my mediocre javascript skills 😅 (or both).

     

    I gave every box data-num attribute, and onDragEnd, I'm looking for the value of this data-num attribute and add or subtract it from the price. This works most of the times, but when you keep dragging the boxes in and out, eventually you'll run into the following error:

     

    pen.js:21 Uncaught TypeError: Cannot read property 'value' of undefined
        at Draggable.onDragEnd (pen.js:21)
        at Ma (Draggable.min.js:10)
        at HTMLDocument.onRelease (Draggable.min.js:10)

     

    So sometimes the value of the attribute is undefined. 

    Do you perhaps have any idea how I could improve the code so it keeps working? 

    Many thanks!

     

  5. Hello! 

     

    I was wondering if it's possible to make a draggable calculator. 

    In my pen, you see some blocks with a number. What I'm trying to achieve, is that if you drag a numbered block inside the square, that the number on the block is added to the price, and when you drag a block outside of the square, that the number is subtracted from the price. 


    What would be the best way to approach this? 

    Many thanks for your help! 

    See the Pen PoWYpZz by Vrielsdenies (@Vrielsdenies) on CodePen

×
×
  • Create New...