I’ve got a simple carousel implementation which I’m trying to tweak a bit to match some very specific requirements.
There is an absolutely positioned overlay which highlights the first thumbnail of the carousel when the page first loads up.
When the mouse is moved over to another visible thumbnail in the carousel, I need it to slide across to that thumbnail, and update the text within the overlay to the new image number (out of x number of images).
Now, I have spent nearly a full day trying to get the animation to happen nicely. I’ve tried with multiple approaches, and I’m getting quite frustrated. It is probably due to my lack of CSS3 ninja-ness.
Here’s an updated version of the fiddle. Code is as follows for the
<img>mouseover event:The last bit of the code that would need to be tweaked is resetting the overlay’s left position on the carousel’s prev/next actions. I didn’t add this bit but it’s just a matter of animating the
leftproperty to its original offset.