Jump to content

animate window onShow / onClose


erich.wanker

Recommended Posts

Hello folks ...

 

i am searching a solution (i think javascript is the right way - but not my strength) for following situation:

 

if a uniForm is shown (Or Create) - it should be created  on -> main.width + newform. width 

when - it schould animate to     ->  trunc (main.width / 2) - ( newform. width / 2 )

 

and uniForm before close - it should animate to  negative value of newform.width .. and if it reaches the position - it should close ..

 

in small words:

  • onShow or OnCreate - it slides in from right to middle of the screen
  • onBeforeClose - it slided out and close itselfe

 

Can someone please help me :-) ... 

 

ThanX

 

Erich

Link to comment
Share on other sites

Hello :-)

 

i found a small solution:

function window.beforeclose(panel, eOpts)
{
 panel.animate({ duration: 300, to: { x:-1000, opacity: 0} });
}
function window.beforeshow(sender, eOpts)
{
 sender.animate({ duration: 0, to: { x:2000, opacity: 0} });
 sender.animate({ duration: 300, to: { x:200, opacity: 100} });
}

 

 

 

Now i have additional questions:

 

in function "window.beforeshow" :

  • How can i set the first value of "x" to Mainform.width + 100  ... so the form is out of the browser-area
  • How can i set the second value of "x"  to  trunc( (Mainform.width/2) - (the form.width/2) ) ... so the form is in the middle of the screen

 

 

 

AND...

 

..is it possible to add this "Slide in / Slide out" - Effect to a message Dialog ? .. would be cool ;-)

 

 

ThanX for suggestions

Link to comment
Share on other sites

  • 2 years later...
i used of this code.

i want to place left of the form at the center of screen.

how to do this?



function window.beforeshow(sender, eOpts)
{
sender.animate({ duration: 200, to: { x:450, opacity: 100} });
}

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...