PDA

View Full Version : Creating Fade in Elements



kouphax
30 Jan 2008, 7:25 AM
First things first, I apologise if this is really obvious but I think my brain has locked up today.

I have a div on a page and when a certain event occurs (fired by reverse ajax on the server side) it appends a div of text onto the end of the main div. Now maybe I am missing something really obvious but how do I create the div so that it fades in? My function is just passed the string of text.

Again this is probably really easy but I've thought about it and I just can't see it. I've also looked through the API but it's not jumping out at me. The DomHelper append function doesn't seem to be animate-able (if that's even a word).

James

catacaustic
30 Jan 2008, 2:22 PM
Have a look at the Ext.Fx functions. They should be able to help you out with what you are after.

devnull
30 Jan 2008, 3:56 PM
It seems like you should be able to create the div with a css rule to set it hidden to begin with, then access it as an Ext.Element if it isnt already (Ext.get('myDivID') and call it's show method with a properly configured animate object as an argument.
On a side note, I would be very interested in learning more about your reverse ajax setup :)