<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js""></script> </head> <body> <ul class="slides"> <li class="screenshot"><p>Text 1</p><img class="phone" src="one.png"></li> <li class="screenshot"><p>Text 2</p><img class="phone" src="two.png"></li> <li class="screenshot"><p>Text 3</p><img class="phone" src="three.png"></li> <li class="screenshot"><p>Text 4</p><img class="phone" src="two.png"></li> <li class="screenshot"><p>Text 5</p><img class="phone" src="three.png"></li> </ul> <script> $(function () { $('#right-arrow').click(function (ev) { ev.preventDefault(); var $visibleImage, total, stack; $visibleImage = $('.screenshot:visible'); total = $('.screenshot').length; stack = $visibleImage.prevAll().length; $(this).attr('href') === stack++; if (stack === total) { stack = 0; } $visibleImage.fadeOut('slow'); $('.screenshot:eq(' + stack + ')').fadeIn('slow'); }); }); </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)