I am trying to run jquery animations in sequence but cannot seem to get it working...
// Run this animation first hiding fading all divs but selected one
if (divid!= '1') { $('#div1').animate({ 'opacity': 0 }, 500); }
if (divid!= '2') { $('#div2').animate({ 'opacity': 0 }, 500); }
if (divid!= '3') { $('#div3').animate({ 'opacity': 0 }, 500); }
if (divid!= '4') { $('#div4').animate({ 'opacity': 0 }, 500); }
if (divid!= '5') { $('#div5').animate({ 'opacity': 0 }, 500); }
once all the above animations have finished do the next lot...
if (cargroup != '1') { $('#div1').hide(500); }
if (cargroup != '2') { $('#div2').hide(500); }
if (cargroup != '3') { $('#div3').hide(500); }
if (cargroup != '4') { $('#div4').hide(500); }
if (cargroup != '5') { $('#div5').hide(500); }
and so on...
dividandcargroupfrom? You can just pass the id and animate the right div instead of checking for each like that. Can you provide any more info/expand on your question?