Experimental CSS3 Animations for Image Transitions

Today we want to share some experimental 3D image transitions with you that use CSS3 animations and jQuery. We'll be using CSS3 3D Transforms for Webkit only.

From our sponsor: Market smarter with Mailchimp's automated messaging tools.

Today we want to share some experimental 3D image transitions with you that use CSS3 animations and jQuery. We’ll be using CSS3 3D Transforms for Webkit only. Check out the Photo Transitions at the Safari Technology Demos site, some of which we got inspired by.

The images used in the demo are by Joanna Kustra.

Please note that the 3D effects will only work in Webkit browsers. You can view a video of how the effects look here: Experimental CSS3 Animations for Image Transitions Video Demonstration

How it works

Given a set of images, we’ll add the first image to the wrapper with the class te-cover. With JavaScript we’ll control the transition classes given to the elements in the wrapper te-transition and which image will be shown. This is how the first example looks like:

<div id="te-wrapper" class="te-wrapper">
	<div class="te-images">
		<img src="images/1.jpg"/>
		<img src="images/2.jpg"/>
		<img src="images/3.jpg"/>
		<img src="images/4.jpg"/>
		<img src="images/5.jpg"/>
	<div class="te-cover">
		<img src="images/1.jpg"/>
	<div class="te-transition">
		<div class="te-card">
			<div class="te-front"></div>
			<div class="te-back"></div>

The main idea is to always show the regarding image using te-cover. When we start an animation by giving the respective animation class, the te-cover will get hidden while the animation runs. When the animation finishes, the te-cover element will be shown again, with the updated image.


Each demo will have a group of possible transitions that can be selected from the dropdown menu above the image.

  1. Demo 1: Flip
  2. Demo 2: Rotate
  3. Demo 3: Multi-Flip
  4. Demo 4: Cube
  5. Demo 5: Unfold
  6. Demo 6: Others

We hope you like our little experiment and find it inspiring and useful!

Tagged with:

Stay up to date with the latest web design and development news and relevant updates from Codrops.

CSS Reference

Learn about all important CSS properties from the basics with our extensive and easy-to-read CSS Reference.

It doesn't matter if you are a beginner or intermediate, start learning CSS now.

Feedback 46

Comments are closed.
  1. @CHINMAY “This is Golden. CSS3 Eliminating Flash Completely. :)”

    Seriously? Oh how I hate remarks like this. Not only because it is completely ill-informed (you do realise how little market share Webkit still has, right?) but also because of the huge and biased naivety displayed. Flash allows a designer/develop to deploy across multiple platforms without writing and rewriting multiple code variants to appease browser idiosyncrasies. It also remains the simplest, most effective way to achieve many of today’s must-have features. For example, why exactly do I want or need to host several different versions of my video file?

    Apple, much as I have always loved them, have done a massive disservice to the design community in seeking to kill off Flash. And technologies such as jQuery, CSS3 etc are really still playing catch-up on features that Flash has provided for years. Something to think aboutโ€ฆ

  2. as long as the old navigators ‘ll survive.. will be difficult to apply that.. even if i’ll like to to do that and to put IE and all non webkit browsers in the trash can !!!

    it is my wish for Christmas ๐Ÿ™‚

  3. a) The demo doesn’t work in Safari 5 in windows.

    b) Thank you Grey Man. Hopefully more and more people will stop drinking the Apple Kool-aid and start to think about the reality of Flash (and Silverlight and Java). I love Flash but I look forward to the day when open standards and full DOM integration rule the internet…

    …but in practical terms, that day is far from close and it’s a far better thing to push ALL technologies as far as they can go in the mean time, not just make small steps for niche slideshows.

  4. Bashing browsers that aren’t webkit is just stupidity, as are any comments that suggest these sorts of techniques are the death of flash. They aren’t, because it will be several years before most people are using a browser capable of rendering these animations. These are lovely, but in a commercial project, completely unusable – at least without some sort of fallback/degradation.

  5. By a fallback, I mean an alternative animation method. The pictures change fine in other browsers.

  6. I am glad to see that my post that I posted was deleted

    Do you keep only the positive posts ?

  7. Thank you all for your feedback!
    @PATRIOT Relax man! I don’t think any of your comments was deleted. I see the 3 comments you wrote here. Which one are you referring to?

    • Hi Chris, thanks for your feedback, I’ve tried to make it work in Aurora but I failed. It’s not that simple as to just add the -moz- prefixes for it, I guess. Maybe I missed something and I decided to leave it as a Webkit only experiment. I’m guessing that it has something to do with the animation-fill-mode, any ideas?

  8. re:patriot @ 12:51

    It isn’t Webkit who has the problem. It’s the others. ๐Ÿ˜‰

    Awesome script. Gr8 inspiration.