I try to make an increment on every click, however I am stuck with this original code:
$('.de img').click(function() {
scroll = $('body').scrollTop();
imgJump = $(this).prevAll().length;
var $this = $(this),
bigImgs = $('.biggie:hidden').find('img:hidden');
console.log(bigImgs[imgJump]);
$('.de').fadeOut(400, function () {
$('body').scrollTop(0);
$('.biggie').fadeIn(400);
});
$(bigImgs[imgJump]).fadeIn(400);
$('.biggietext').fadeIn(400);
$('.number').text(imgJump + 1);
});
$('.biggie img').click(function(){
var imgIs = imgJump + 1,
imgIss = imgIs++;
if ($(this).nextAll().length > 0) {
$(this).fadeOut(400, function() {
$(this).next().fadeIn(400);
});
$('.number').text(imgIss);
}
});
Here is a jsFiddle with an easier version: http://jsfiddle.net/nU63B/3/.
Why is this not working?
Thanks!!
+1addition and then the following increment.