I'm gonna give you a general idea, i didn't try to run the code so i'm not sure it works. The changes i've made are marked red, the code that i don't understand is grey because i'm not sure if it's supposed to go in the "else" block or not.
Code:
<script type="text/javascript">
$(document).ready(function(){
$('#slideshow img').hide();
$('#slideshow img:first').show();
function slide(){
var $top = $('#slideshow img:visible');
var $next;
var $current = 1;
if ($top.next().length > 0) {
$next = $top.next();
$current++;
} else {
$next = $('#slideshow img:first');
$current = 1;
}
$top.hide();
$next.show();
$('#currentImage').text($current + "/" + $iCount);
}
var $imgCount = $('#slideshow img');
var $iCount = $imgCount.length;
$('#slideshow img').click(slide);
$('#totalImages').text($iCount);
});
</script>
Last edited by 3Nex; 05-27-2011 at 04:35 AM.
i love easter eggs
(if you got any creative easter eggs, send me a PM)
Bookmarks