Can someone recommend me some jQuery plugin, for the rotating this HTML structure.
<div id="event_rotator">
<div class="event">
<h2>Title</h2>
<p>Text</p>
</div>
<div class="event">
<h2>Title</h2>
<p>Text</p>
</div>
<div class="event">
<h2>Title</h2>
<p>Text</p>
</div>
</div>
I would like, that it would rotate the automatically in the certain time period, when the user is on the page, and also that user can rotate it left and right with a click on an arrow.
I tried to use this http://jquery.malsup.com/cycle/pager11.html , but I cannot get it to work.
The problem is, that I get this HTML dynamically, out of a PHP code.. I don't know, how to assign the needed css (I can assign that which is the same for all, but I cannot assign different Z-index.
http://jsbin.com/ofukaq/8/edit
How to make this to loop shown titles like:
Title 1 -> Title 2 -> Title 3 -> Title 1 -> title 2 ->
infinity loopInstead of
?
I created this in 10 min, so it's not a designer's gallery, but this one has all you need to use and LEARN how to create your self a slide gallery with left/right buttons, auto-rotate and hover/pause.
The HTML,CSS,JS code is really simple so take a look:
http://jsbin.com/ofukaq/8/edit
HTML:
CSS:
and finally jQuery:
Hope I opened your eyes that sometimes you don't need a 3000 lines plugin to build a nice gallery with all the functionality you need.
Here is with a bit compressed jQuery script using Ternary operators:
jsBin demo