Return to Snippet

Revision: 43073
at March 16, 2011 05:47 by Zedley


Initial Code
<ul class="rotater">
<li class="active"><img src="null.jpg" /></li>
<li><img src="null.jpg" /></li>
<li><img src="null.jpg" /></li>
<li><img src="null.jpg" /></li>
</ul>

<script type="text/javascript">
$('.rotater li').hide().eq(0).show().click(function() {
  b = $('rotater li').length;
  b--;
  a = $('.active').index('rotater li');
  $('.active').fadeOut().removeClass('active');
  if (a == b) {
    a = -1;
  }
  a++;
  $('.rotater li').index(a).fadeIn().addClass('active');
  
});

Initial URL

                                

Initial Description

                                

Initial Title
Rotate on Click (jQuery)

Initial Tags

                                

Initial Language
JavaScript