I have a nested function to show / hide news-ticker-style items.
The problem is that when the cycle starts (line 4), the opacity effects stop working correctly, so the paragraphs appear suddenly.
Any jquery wizards know about this? Am I doing this too hard?
$('#special-ticker p').hide(); var a=0; function outer() { function inner() { if(a===$('#special-ticker p').length) { a = 0; } $('#special-ticker p'). eq(a). fadeIn(800, function(){ $(this).animate({opacity:100},10000,null,function(){ $(this).hide(800,function(){ a++; outer(); }); }); }); } return inner(); } $(function(){ outer(); });
source share