I feel like I should be able to find this from a google search, but have not, so I’ll ask it here.
I keep getting an error on the second if statement, so I was wondering if it was not allowed to place another if statement inside a pre-existing if/else statement.
Thanks for looking.
function flipImages(){
currentImage = flipArray[i];
if (i == 6) {
clearInterval(interval)
}
else {
// add an opacity animation to the flip so that it is less jarring
// set at a 100ms fade in
$(currentImage).animate({
opacity: 1
}, 100, function() {
console.log(flipArray[i]);
}
// also animate in the child divs of the currentImage (which will only be text on
// the "final" div)
if ( $(currentImage).children().hasClass('final'){
$(currentImage).children().animate({
opacity: 1,
left: '+=50'
}, 500, function(){
console.log( $(currentImage).children() );
});
});
);
i++;
};
}
U’ve missed a ) after
if ($(currentImage).children().hasClass('final')and also couple of semicolons that makesit an invalid js.Check it here