28
Aug
08

Spacegallery Implementation in ExtJS

Yesterday I had a short discussion with a colleague of our front-end/website team. We had a look a gallery implementation made in JQuery.  He wanted to have a similar animation like the rezise/move/fadeout animation when an image gets clicked in this gallery.

The question was how hard it would be to implement such an animation. My short answer was: “I guess this is about 5 lines of code”. Well, I have never worked with JQuery and animation in general, and after looking into the code I realized, that JQuery seems to differ conceptually a lot from ExtJS.

However a few weeks ago I roughly scanned the docs of Ext.Fx. This is a small but very powerful Effect class in ExtJS. Many people think, ExtJS is ‘just’ suited for Web-Apps with a look similar to the Tine 2.0 look. But this is not the whole truth. ExtJS is also a general purpose JS Library with also comes with great animation and effects support.

As you can see bellow, I couldn’t resist to implement a spacegallery using ExtJS. The code for all animations, not only the animation of the top Image, is just 4 Lines of code:

onImageClick: function(e, dom) {
this.imageEls[0].shift(this.fadeOutPerspectiveData);
for(var n=1; n this.imageEls[n].shift(this.perspectiveData[n-1]);
}
this.cycleStack();
},

Ok, it's a matter of interpretation if you count the single "}" line :-) .


3 Responses to “Spacegallery Implementation in ExtJS”


  1. 1 maduks Dec 9th, 2008 at 10:57 am

    very good, implementation of efects y extjs i’ll use it somewhere, in a gallery, thaks for the implementation

  2. 2 Games Feb 16th, 2009 at 3:18 am

    That’s a great effect, absolutely love it. I have a site built around extjs selling pc and console games. This effect would be perfect for navigating through screenshots etc.

  3. 3 Kiran Oct 21st, 2009 at 9:58 am

    Hi,

    Can you please post the source code for the source images taken? Also please elaborate the code written above I am unable to get it, means how it accesses the images.

    Thanks

Leave a Reply