Jump to content
GreenSock

Lollibomber

ShockinglyGreen
  • Posts

    2
  • Joined

  • Last visited

About Lollibomber

Lollibomber's Achievements

  1. Thank you for pointing me to the right direction. I noticed that this does not animate, but does change the aspectRatio: gsap.set(svg,{attr:{preserveAspectRatio:"xMaxYMax slice"}}); gsap.to(svg, 1, {attr:{preserveAspectRatio:"xMinYMax slice"}}); So by first animating the viewbox, and the end of the animation changing the preserveAspectRatio that way, I could establish what I wanted. Thanks!
  2. I've got a svg-file that I placed (due to responsive reasons) this way: <svg width="100%" height="100%" viewBox="0 0 1000 500" preserveAspectRatio="xMaxYMax slice" class="MAIN">My super duper svg</svg> I want to animate this svg with some kind of event to <svg width="100%" height="100%" viewBox="0 0 1000 500" preserveAspectRatio="xMidYMax slice" class="MAIN">My super duper svg</svg> In other words, the position of the svg changes from "xMaxYMax slice" to "xMidYMax slice" (depending on the aspect ratio of the browser). Is there a way to achieve this? Maybe with FLIP?
×