Index: dynamicload.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/jstools/dynamicload/dynamicload.js,v
retrieving revision 1.18
diff -u -r1.18 dynamicload.js
--- dynamicload.js	7 Mar 2007 04:55:51 -0000	1.18
+++ dynamicload.js	10 Mar 2007 15:57:26 -0000
@@ -95,9 +95,53 @@
     success: function(response){
       response = Drupal.parseJson(response);
       if (response.result) {
+        // If there are list items, fade in the new ones.
+        if (var count = $(selector + ' div.item-list li').size()) {
+          var firstHref = $(selector + ' div.item-list li a:first').attr('href');
+          var isNew = true;
+          var new = [];
+          $(selector)
+            .attr('id', 'dynamicload-old')
+            .after(response.content)
+            .next('div.block')
+            .hide()
+            .find('div.item-list li')
+            .each(function () {
+              if (isNew && ($(this).attr('href') != firstHref)) {
+                new.push($(this).clone());
+              }
+              else {
+                isNew = false;
+              }
+            })
+            .end()
+            .end()
+            .find('div.item-list ul:first')
+            .each(function () {
+              for (var i in new) {
+                // Append and fade in the new content.
+                $(this).prepend(new[i]);
+                $(new[i]).fadeIn('slow');
+                // Remove the old content.
+                // If it's the last old content to be removed, replace the old block with the new one.
+                if (i == (new.length - 1)) {
+                  $('dynamicload-old div.item-list li:last').fadeOut('slow', function () {
+                    $('#dynamicload-old').remove();
+                    $(selector).show();
+                  });
+                }
+                else {
+                  $('#dynamicload-old div.item-list li:last').fadeOut('slow');
+                }                
+              }
+            });
+        }
+        // Otherwise simply replace the existing block.
+        else {
         $(selector)
           .after(response.content)
           .remove();
+        }
       }
     }
   });
