3D Gallery with CSS3 and jQuery

Today, we want to share an experimental 3D gallery with you that uses CSS 3D transforms.

From our sponsor: Elevate all your marketing with Mailchimp Smarts.

With 3D transforms, we can make simple elements more interesting by setting them into three dimensional space. Together with CSS transitions, these elements can be moved in 3D space and create a realistic effect. Today, we want to share an experimental 3D gallery with you that uses CSS 3D transforms.

The main idea is to create a circular gallery where we have an image in the center and two on the sides. Since we are using perspective, the two lateral images will appear three dimensional when we rotate them.

Please note that this will only work in browsers that support CSS 3D transforms.

How it works

The following HTML structure is used for the gallery:

<section id="dg-container" class="dg-container">
	<div class="dg-wrapper">
		<a href="#">
			<img src="images/1.jpg" alt="image01">
		<a href="#">
			<!-- ... -->
		<!-- ... -->
		<span class="dg-prev"><</span>
		<span class="dg-next">></span>

And this is how the gallery is initialized:



The following options are available:

current		: 0,	
// index of current item

autoplay	: false,
// slideshow on / off

interval	: 2000  
// time between transitions

I hope you enjoy it!

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 69

Comments are closed.
  1. Really nice effect when viewed in a WebKit browser, has some issues with scrollbars appearing when viewed in the latest FireFox (v10).

    Iron out these FF bugs and it’s a winner!

  2. Nice gallery, quite inspiring for a new projekt.
    But It ís´n working good in in FF 10, the images flicker on action or aren´t displayed at all.
    Works fine in Chrome and Safari.

  3. I live this site so much. I can’t wait to see their next post. The work done is brilliant. keep it up

  4. does not work correctly in Opera (last version). After the first click on the arrows, they stop working. Sorry for my English. Helps Google Translator. )))

  5. Nice effect! Did some browser testing and even IE8 works nicely except for the 3d animation of course, but the main point it’s accesible. Only Opera (11.61) has a strange behavior. I only can click once on a next/previous arrow and after that it blocks… I can’t navigate the slideshow anymore. But hey… it.s an experiment, I know, and it looks awesome in Chrome 🙂

  6. It seems that jquery.gallery.js couldn’t added ‘z-index: 999’.
    I try to fix js, then I did it.
    It works good at Firefox(v10)

    # I changed this part…
    jquery.gallery.js line: 154 ~ 158

    ‘z-index’ : 999,
    ‘opacity’ : 1,
    ‘visibility’: ‘visible’

  7. Thanks for this beautiful sharing and a big red card for the browsers that doesn’t support CSS 3D transformations

  8. Amazing, this is a great example of what can be achieved with CSS.

    Only 2-3 more years till it will be usable…