I have a really fun and stylish demo of banner-style javascript animation for you. The main player here is TimelineLite from GreenSock’s tangy Javascript port. I created this demo to try to prove to myself that:
- banner animation outside of Flash is viable
- the performance and precision of sequencing would not be barriers
Come inside to judge for yourself.
I don’t know about you, but I would have a tough time betting any money on whether or not that is Flash or JavaScript.
Although it may not be the most draw-dropping animation you have ever seen, I was able to very precisely stagger the sequence of animations exactly how I wanted them. Certain animations overlap with each other while others go in direct sequence.
Some of the beautiful benefits of tying all the animations into a TimelineLite are:
- You don’t have to manually track and increment delay properties.
- You can globally adjust the playback speed of the entire animation.
- You can immediately jump to certain sections of the timeline. For instance if I want to fine-tune a transition at the end, I can just do
timeline.seek(timeline.duration()-2)and skip over the intro every time I preview. I could also jump to a labeltimeline.seek("comment2")
Inherent Difficulties
Coming from a Flash perspective there are definitely drawbacks to using javascript. Most notably vectors, 3D rotation and the whole gamut of Flash filters (drop shadows, blurs, glows etc) don’t have the cross-browser and multi-device support necessary to serve to a wide audience. So from a creative standpoint you have to make some compromises.
I decided to hand-code all aspects of the banner above. The most grueling part is grabbing coordinates from photoshop and typing them into CSS. I imagine I will find a workflow that involves Dreamweaver, Edge and/or the new Flash CS6 HTML5 export features to streamline that a bit. Once the assets are positioned, the GreenSock side of things is a breeze.
Being that I’m just really trying to experiment with the raw guts of GSAP v12, I didn’t spend a lot of time optimizing. Emrah Atilkan has pointed me in the direction of Sizzle.js to use as a lightweight alternative to jQuery as a selector engine. And to go really lean and mean its pretty easy to target any element via getElementByID (thanks Matt). I plan on experimenting with a variety of methods and boiling this kind of work down to the bare bones.
All the text-blocks in the example above are images. In some ways using @font-face makes sense but not so sure the filesize is always going to work in its favor. Also, some browsers don’t handle moving and scaling text all that great.
Share your thoughts
I would be very interested in hearing from you guys what you think of javascript as being a viable alternative for banners in the near future. I always held the opinion that the publishers/networks would be very slow to adapt. From what I see most of the big guys are still serving up Flash 8/9 AS2, but my perspective is limited. I got some really valuable insight from Randall on how javascript animation is making some huge advances in the ad space.
If you have any insight on where this stuff is going, I’d love to hear. From what I can tell there is plenty you can do today to create engaging animation outside of Flash. Most importantly it gets you onto iOS (like it or not). Sure it isn’t as dead-simple as Flash but it is doable and the tooling is getting better.
What do you see as the barriers of javascript animation going mainstream?
What platforms are you using today that allow you to serve rich js ads to the masses?
Sound off in the comments.
Best,
Carl
ps. I’m really interested in seeing what has and can be done. If you have created any javascript-based banner animations, tweet them my way ( @snorklTV ) and I will be glad to pass them around.





