erich.wanker Posted June 27, 2017 Share Posted June 27, 2017 Hello, i use TweenLite for animations... i want to slide a form from top:-1000 to the middle of the screen with alpha 0-100% ... i use ClientEvent-ExtEvent: function window.show(sender, eOpts) { function FixMe() { V_FRAME_VERTRAG_STRUKTUR.UniDBGrid3.doLayout( ); V_FRAME_VERTRAG_STRUKTUR.UniDBGrid2.doLayout( ); } TweenLite.set('#'+sender.getId()+'', {y:-1000,autoAlpha:0,display:"block"}); setTimeout(function() { TweenLite.to('#'+sender.getId()+'', 0.4, {autoAlpha:1, y:0, ease:Back.easeOut.config(1), delay:0.15, clearProps:"transform",onComplete:FixMe}); }, 200); } the problem ist the last "tweetLite.to": y:=0 should be trunc( screen-height - formheight /2) how can i make this in Javascript? And suggestions? ThanX Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 27, 2017 Share Posted June 27, 2017 Hi, Maybe you wanted like this ?!: Math.trunc($(window).height() - this.getHeight()/2)Best regards, Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted June 27, 2017 Author Share Posted June 27, 2017 WORKS PERFECT !! THANX :-) function window.show(sender, eOpts) { function FixMe() { V_FRAME_VERTRAG_STRUKTUR.UniDBGrid3.doLayout( ); V_FRAME_VERTRAG_STRUKTUR.UniDBGrid2.doLayout( ); } var posi = Math.trunc(($(window).height() - this.getHeight())/2); TweenLite.set('#'+sender.getId()+'', {autoAlpha:0,y:-1000,display:"block"}); setTimeout(function() { TweenLite.to('#'+sender.getId()+'', 0.5, {autoAlpha:1,y: posi, display:"block", ease:Back.easeOut.config(1), onComplete:FixMe}); }, 200); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.