Forum Discussion
GSAP, x-y transformation in the Modern Player
Hi Math,
Currently figuring out GSAP and testing with a few demos.
I'm not sure I follow when you suggest using % values to solve the zoom issue?
For example, I'm using a scale animation on an object to fill the screen but then if I zoom in/out it resets to it's original size
Here's the example:
https://360.articulate.com/review/content/b87bcf58-6e7e-453f-ad93-bed2bf5ec5bb/review
Thanks in advance!
- MathNotermans-92 years agoCommunity Member
Indeed that is some peculiar behaviour. Probably you should add a event handler to watch a resize of the window... in not tested dummy code some like this...
window.addEventListener("resize", ResizeHandler, false);function ResizeHandler(e)
{
var e = window.event || e; // old IE support
var viewportWidth = window.innerWidth || document.documentElement.clientWidth;
var viewportHeight = window.innerHeight || document.documentElement.clientHeight;
console.log("ResizeHandler: vw = "+viewportWidth+" | vh = "+viewportHeight);
gsap.set(myShape,{scale:percentagetoscalefromOriginalToviewportMax})return false;
} - rosycolelli12 months agoCommunity Member
@James could you share your file? Thank you!