I'm using deck.js for a presentation. For one slide, I want a static header with figures/images that I can carousel through. Here's the relevant HTML:
<section class="carousel slide">
<h2>Static Title</h2>
<figure class="slide"><figcaption>Text for first image</figcaption><img src="images/first_image.png" alt=""></figure>
<figure class="slide"><figcaption>Text for second image</figcaption><img src="images/second_image.png" alt=""></figure>
<figure class="slide"><figcaption>Text for third image</figcaption><img src="images/third_image.png" alt=""></figure>
</section>
And here's the JS I've added to deck.js to make this work with the horizontal-slide theme that comes with deck.js.
.carousel .deck-before {
-webkit-transform: translate3d(-400%, 0, 0);
-moz-transform: translate(-400%, 0);
-ms-transform: translate(-400%, 0);
-o-transform: translate(-400%, 0);
transform: translate3d(-400%, 0, 0);
height:0;
}
.carousel .deck-after {
-webkit-transform: translate3d(400%, 0, 0);
-moz-transform: translate(400%, 0);
-ms-transform: translate(400%, 0);
-o-transform: translate(400%, 0);
transform: translate3d(400%, 0, 0);
height:0;
}
.carousel .deck-next {
-webkit-transform: translate3d(200%, 0, 0);
-moz-transform: translate(200%, 0);
-ms-transform: translate(200%, 0);
-o-transform: translate(200%, 0);
transform: translate3d(200%, 0, 0);
height:0;
}
.carousel .deck-previous {
-webkit-transform: translate3d(-200%, 0, 0);
-moz-transform: translate(-200%, 0);
-ms-transform: translate(-200%, 0);
-o-transform: translate(-200%, 0);
transform: translate3d(-200%, 0, 0);
height:0;
}
This works great when the carousel of images is going forward. However, when I go back, the image that is moving off the screen shifts down so it is below the spot where the new image is entering.
How do I make it so that the image that is moving off the right of the screen stays level with the image that is coming on the screen from the left?