[Solved] why animate() doesn’t work well with data()?

My guess is that you should be using $(this).data(), not $(‘div’).data(), so that each DIV will keep track of its own animation state. $(‘div’).click(function () { var data = $(this).data(‘animate’); if ( data == 10 ) { $(this).animate({ height: 100 }, 200); $(this).data(“animate”,”100″); } else if ( data == 100 ) { $(this).animate({ height: 10 … Read more