We needed to create a responsive image carousel and use Gallery CSS (only CSS carousel without javascript - http://benschwarz.imtqy.com/gallery-css/ ).
Below is an example of the markup used (excluding images)
<div class="gallery autoplay items-3"> <div id="item-1" class="control-operator"></div> <div id="item-2" class="control-operator"></div> <div id="item-3" class="control-operator"></div> <figure class="item"> <a href="http://www.google.co.uk"> <h1>First Item</h1> </a> </figure> <figure class="item"> <a href="http://www.bbc.co.uk/news"> <h1>Second Item</h1> </a> </figure> <figure class="item"> <a href="http://www.apple.co.uk"> <h1>Third Item</h1> </a> </figure> <div class="controls"> <a href="#item-1" class="control-button">β’</a> <a href="#item-2" class="control-button">β’</a> <a href="#item-3" class="control-button">β’</a> </div> </div>
Links to external websites work for each of the elements if you click on individual links of the "control button" to get to them. The problem is that if autostart starts, then clicking on any element goes to the first element of the figure and therefore goes to the link www.google.co.uk.
Since the markup does not change with the transition, we cannot select any modified element using jQuery. We tried to add an event handler for "transitionend" (or its browser equivalent), but it never works.
Any insight is appreciated.
Update:
We tried
$(document).ready(function () { $('.item').on('animationend webkitAnimationEnd MSAnimationEnd', function () { alert('fired !!'); }); });
and
$(document).ready(function () { $('div').on('animationend webkitAnimationEnd MSAnimationEnd', function () { alert('fired !!'); }); });
Not a single fire in the animation, whether it is auto play or the press of control buttons.
source share