Jump to content
Search Community

Search the Community

Showing results for tags 'xpercent'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 5 results

  1. Hello everyone! I have some problem to use correctly Scrolltrigger. The problem it show when i try to translate all slide to "xPercent: -100" when scroll. var thirdPanel = document.querySelector(".third-panel"); if (thirdPanel) { var thirdPanelRect = thirdPanel.getBoundingClientRect(); const sectionsThirdPanel = gsap.utils.toArray(".third-panel .slide"); if (sectionsThirdPanel.length > 0) { const numSections = sectionsThirdPanel.length - 1; const snapVal = 1 / numSections; gsap.to(sectionsThirdPanel, { xPercent: -100 * numSections, ease: "none", scrollTrigger: { trigger: ".third-panel .slide-second", pin: ".third-panel", scrub: true, snap: snapVal, start: `top+=${thirdPanelRect.top} top`, end: "+=" + document.querySelector(".third-panel").scrollWidth, markers: { startColor: "red", endColor: "red", fontSize: "3rem", indent: 200, }, }, }); } } For clarity please check my codepen. My intention is to create a "stacking" slide alfter first blue slide. I hope I was clear, open the codepen for best result. For other information please ask. Mattia
  2. Hello, I'm working on a scroll-based reveal animation using ScrollTrigger, but I have trouble finding the right solution. I created a minimal demo that actually works (with minor issues) and looks the way I want. The problem is that I think my solution is a little bit hacky, and probably there's a better way of doing this. The most obvious clue for me is the 'Screen 3' link at the top left corner. I'm using the ScrollToPlugin to scroll down to an id inside the 3rd screen, but it must be clicked multiple times to reach the actual id when you start at the top. Can you help me with some tips or examples so I can achieve the exact same effect with a better working solution? I read that I shouldn't add default CSS transform properties when working with xPercent animations, but this way sometimes the page loads in with the 'Screen 1' section visible. A negative X transformation on the #content selector would solve this issue, but I can't use that because that would break the GSAP animation. What's the best solution to avoid this behavior? Thanks in advance! Adam P.S. I'm not sure why the snap animation is jumping around and moving backward. I have the same code in my project, and it only happens on CodePen.
  3. Hi, there's a strange bug I've been coming across and not sure how to fix, it only happens very occasionally, but does always happen eventually if you keep refreshing. Seems like it's something to do with a wrong 'xPercent' calculation? I'm animating every svg elements y position from bottom to top, fine Then I am animating some elements to 'wiggle' their x and y positions. Sometimes the x axis seems to be wrong and they move much too far I originally thought the problem was because I was trying to animate the wiggle from the start, at the same time as moving everythings 'y' position. But I delayed any 'y' position animations until the first 'move up' animation was finished Funnily enough I can't seem to get the codepen to reproduce this bug... Making me think maybe it's network related, something trying to calculate before the svg is fully loaded...? Anyone seen something similar before, any idea what's going on? Is there a less troublesome way to achieve the same effect? I tried using 'x' instead of 'xPercent' but this made a jump in the animation and also xPercent is preferable as the image resizes a quite lot Thanks ?
  4. Ihatetomatoes

    SVG and xPercent animation

    Hi, I've created SVG animation which you can see below. 1. Demo with animated <g id="tomato"> element http://codepen.io/ihatetomatoes/pen/VYLMrJ This works great in Chrome, but not in FF & IE because I didn't realize that <g> can not be animated because it doesn't have x/y coordinates. 2. Demo with animated <svg id="tomato"> element So I've created svg out of that group and animated that instead. You can see it here: http://codepen.io/ihatetomatoes/pen/xbZzXp Again, this works as expected in Chrome, and FF also bounces the tomato, but some reason the xPercent values are not applied in FF & IE. Any idea why? tl.set(tomatoLeft, {xPercent: 23.6}); tl.set(tomatoLeaves, {xPercent: 41}); 3. Demo with animated <svg id="tomato"> and animating x When I change the xPercent offset to x, everything seems to be working fine also in FF & IE, but I wanted to keep the animation responsive. All I've changed is the xPercent to x like this: tl.set(tomatoLeft, {xPercent: 23.6}); tl.set(tomatoLeaves, {xPercent: 41}); // Became tl.set(tomatoLeft, {x: "+=26px"}); tl.set(tomatoLeaves, {x: "+=26px"}); .to([tomatoLeft, tomatoLeaves], 0.2, {xPercent: 0},"split") // Became .to([tomatoLeft, tomatoLeaves], 0.2, {x: "-=26px"},"split") Here is the updated Codepen, which works fine in FF & IE. http://codepen.io/ihatetomatoes/pen/XJXYZa Questions How do I keep the xPercent offsets and make this work in FF & IE? Maybe I am missing something simple, after staring at the tomato too long. Keep up the great work with GSAP Carl and the team. Cheers Petr
  5. websitewalrus

    Animate element across screen?

    Newbie to GSAP! Working on a pen by leelou (thanks leelou!) with a butterfly flying across the screen. Looking at the pen, is there anyway to start the butterfly from off the left side of the screen, and have it fly out the right side? I'd just like the effect of it flying across the screen but without appearing/disappearing into space, regardless of user's screen size.
×
×
  • Create New...