Live Notification with animate.css animation
Hey together,
i have a small problem, but since the last week i search for a solution, but i can't find it.
This is my actual code:
- var oldValue = null;
-
- function repeatMe() {
- $.ajax({
- url: 'test.php',
- success: function(data) {
- $('.notifications-count').html(data);
- // First Load
- if (oldValue == null) {
- $('.notifications-count').addClass('animated bounceIn');
- }
- // When data is different to oldValue show animation
- else if (data != oldValue) {
- $('.notifications-count').removeClass('animated bounceIn').addClass('animated wobble');
- }
- oldValue = data;
- }
- });
- }
- setInterval(repeatMe, 1000);
My problem is now, the bounceIn animation works correct while page load, the wobble effect works good, when the number of wiki_posts becomes bigger oder smaller.
But only once! What is the problem? Can someone help me?
Thanks in advance
Dennis