Fade in and out


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $('div.hint').children('ul').children('li').hide();
  2. $('p.comments').click(function(){
  3. var trgtUL = $(this).next('div.hint').children('ul');
  4. function fadeInOut(i) {
  5. trgtUL.children('li').eq(i).fadeIn(3000).fadeOut(3000, function() {
  6. if ($(this).next().is('li')) {
  7. fadeInOut(i + 1);
  8. } else {
  9. return false;
  10. }
  11. });
  12. }
  13. fadeInOut(0);
  14. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.