Monday, February 06, 2012

Tutorial 3D Gallery with CSS3 and jQuery

Do you want to share?

Do you like this story?

 Demo     -      Download     -      Source

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.

How it works

The following HTML structure is used for the gallery:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<section id="dg-container" class="dg-container">
    <div class="dg-wrapper">
        <a href="#">
            <img src="images/1.jpg" alt="image01">
            <div>http://www.colazionedamichy.it/</div>
        </a>
        <a href="#">
            <!-- ... -->
        </a>
        <!-- ... -->
    </div>
    <nav>
        <span class="dg-prev"><</span>
        <span class="dg-next">></span>
    </nav>
</section>
And this is how the gallery is initialized:
1
$('#dg-container').gallery();

Options

The following options are available:
1
2
3
4
5
6
7
8
current     : 0,
// index of current item
 
autoplay    : false,
// slideshow on / off
 
interval    : 2000
// time between transitions
I hope you enjoy it!

YOU MIGHT ALSO LIKE

0 komentar:

Post a Comment

Advertisements

Advertisements