This JQuery function should timeout to ensure that each item is delayed 8 seconds after the last. Thus producing a gallery where images fade in and out 8 seconds apart from each other.
It doesn’t work.
Any ideas.
function gallery() {
var timeout = 0;
$('.cornerimg').each(function() {
setTimeout(function() {
$(this).addClass('cornerimgfocus');
setTimeout(function() {
$(this).removeClass('cornerimgfocus');
timeout += 8000;
}, (timeout + 8000));
},timeout);
});
}
Marvellous
1 Answer