I made an animation with jquery and I find myself with 15400 line of code. I have 26 div (images) with IDs: .article1, article2, .article3, .article4, ... article26. When I click on one of them lot of translation will be applied on the others. I want to decrease the number of code lines, i tried a For loop:
for (var i = 1 ; i<=26 ; i++)
{
$('.article' + i]).click(function(){
-- animations --
}
}
But it seems don't work because the value of i will take the last value of the loop (26) so the click function will work only on the div with id .article26.
Thank you.