I have 4 blocks of jQuery that look like this:
$('#aSplashBtn1').click(function(){
$('#divSliderContent div').hide();
$('#divSplash1').fadeIn('slow');
return false;
});
$('#aSplashBtn2').click(function(){
$('#divSliderContent div').hide();
$('#divSplash2').fadeIn('slow');
return false;
});
$('#aSplashBtn3').click(function(){
$('#divSliderContent div').hide();
$('#divSplash3').fadeIn('slow');
return false;
});
$('#aSplashBtn4').click(function(){
$('#divSliderContent div').hide();
$('#divSplash4').fadeIn('slow');
return false;
});
I've tried learning more about javascript arrays and for loops but when I try to implement it into this code it only ends up working for the number 1 block. Could someone show me how they would accomplish optimizing this?