Based on the snippet provided, here is the CSS code that can achieve the desired outcome.
I have included a wrapper div in the sample to act as the viewport, which will display one image at a time.
Additionally, I have eliminated all
tags that clear the float because the CSS relies on float to exhibit images side by side for the slide effect.
<div id="viewport">
<div id="gallery-1" class="gallery galleryid-20 gallery-columns-1 gallery-size-collection">
<dl class="gallery-item">
<dt class="gallery-icon portrait">
<a data-lightbox-gallery="lightbox-gallery-1" href="image1.jpg" data-rel="lightbox-gallery-1">
<img id="image1" style="border: medium none;" class="attachment-collection" alt="image1" height="420" width="300">
</a>
</dt>
</dl>
<dl class="gallery-item">
<dt class="gallery-icon portrait">
<a data-lightbox-gallery="lightbox-gallery-1" href="image2.jpg" data-rel="lightbox-gallery-1">
<img id="image2" style="border: medium none;" class="attachment-collection" alt="image2" height="420" width="300">
</a>
</dt>
</dl>
<dl class="gallery-item">
<dt class="gallery-icon portrait">
<a data-lightbox-gallery="lightbox-gallery-1" href="image3.jpg" data-rel="lightbox-gallery-1">
<img id="image3" style="border: medium none;" class="attachment-collection" alt="image3" height="420" width="300">
</a>
</dt>
</dl>
</div>
</div>
I have assigned unique ids to each image for distinct styling options using CSS.
Now, concerning the CSS rules:
/* STYLING FAKE IMAGES - NOT PART OF THE ACTUAL SOLUTION */
#image1{background-color: red;}
#image2{background-color: green;}
#image3{background-color: blue;}
#viewport{width: 300px; overflow: hidden;}
#gallery-1{width: 900px; height: 420px; white-space: nowrap;}
#gallery-1 dl{float: left; margin: 0;}
/* HOVER TRIGGER FOR ANIMATION USING KEYFRAMES TO SLIDE AND PAUSE */
#viewport:hover #gallery-1{
-webkit-animation-name: slide;
-webkit-animation-duration: 4s;
-webkit-animation-timing-function: ease-in;
-webkit-animation-iteration-count: infinite;
}
/* 4 SECOND ANIMATION WITH SPECIFIC PERCENTAGE VALUES TO EMULATE IMAGE PAUSES */
@-webkit-keyframes slide
{
0% { transform: translateX(0); }
15% { transform: translateX(-300px); }
35% { transform: translateX(-300px); }
50% { transform: translateX(-600px); }
70% { transform: translateX(-600px); }
85% { transform: translateX(0); }
100% { transform: translateX(0); }
}