jquery - Reverse Image Loop -
ok found script on internet, forgot source.
but every time image clicked moves forward down list hides , shows image.
i have since modified extensively!
however gets stuck:
<script type="text/javascript"> $(document).ready(function () { var count = $('.image_news').length; $("#total").text(count); $('.image_news:gt(0)').hide(); var $slides = $('.image_news'); $slides.click(function () { var $current = $(this); if ($current.is($slides.last())) { $("#current").text("1"); $current.hide(); $slides.first().fadein(1000).show(); } else { $("#current").text($current.next().index()+1); $current.hide().next().fadein(1000).show(); } }); }); </script> <script type="text/javascript"> $(document).ready(function () { var count = $('.image_news').length; $("#total").text(count); $('.image_news:gt(0)').hide(); var $slides = $('.image_news'); var $backarrow = $('.back-arrow'); $backarrow.click(function () { var $current = $slides; if ($current.is($slides.first())) { $("#current").text(count); $current.hide(); $slides.last().fadein(1000).show(); } else if (!$($current.is($slides.last()))) { $("#current").text($current.prev().index()-1); $current.hide().prev().fadein(1000).show(); } else { } }); }); </script>
i assigned new image check see @ in loop, after first click gets stuck!
relooping back.
i cant life of me figure out logic errors are...
here active page:
any input appreciated!
g
$backarrow.click(function () { var $current = $slides;
wants be:
$backarrow.click(function () { var $current = $slides.filter(':visible:first');
Comments
Post a Comment