Index: floating_block.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/floating_block/floating_block.js,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 floating_block.js
--- floating_block.js	29 Aug 2010 05:47:11 -0000	1.1.2.1
+++ floating_block.js	25 Oct 2010 13:40:18 -0000
@@ -22,33 +22,18 @@ Drupal.behaviors.blockFloat = function (
     return;
   }
   
-  // Keep track of all cloned blocks.
+  // Keep track of all floating blocks.
   var blocks = [];
   $(Drupal.settings.floating_block).each(function (i, selector) {
     $(selector.toString() + ':not(.blockFloat-processed)', context).each(function (j, block) {
-      // Clone thead so it inherits original jQuery properties.
-      var blockClone = $(block).clone(true).insertBefore(block).addClass('sticky-block').css({
-        position: 'fixed',
-        top: '0px',
-        width: $(this).width(),
-        height: $(this).height(),
-        visibility: 'hidden'
-      });
-
-      if ($(block).attr('id').length > 0) {
-        $(blockClone).attr('id',$(block).attr('id') + '-clone');
-      }
-      blockClone = $(blockClone)[0];
-      blockClone.original_position = $(block).offset();
-      blockClone.original_identifier = 'blockFloat-' + blocks.length;
-      blocks.push(blockClone);
-
-      // Finish initialzing header positioning.
-      tracker(blockClone);
-
-      //Maybe need to attach soemthing to parent div?
-      //$(table).addClass('sticky-table');
-      $(block).addClass('blockFloat-processed ' + blockClone.original_identifier);
+      var blockInfo = [];
+      blockInfo.original_position = $(block).offset();
+      blockInfo.original_css_position = $(block).css("position");
+      blockInfo.original_identifier = 'blockFloat-' + blocks.length;
+      blocks.push(blockInfo);
+      // Initialzing block positioning.
+      tracker(blockInfo);
+      $(block).addClass('blockFloat-processed ' + blockInfo.original_identifier);
     });
   });
 
@@ -56,34 +41,32 @@ Drupal.behaviors.blockFloat = function (
   function tracker(e) {
     // Save positioning data.
     var viewHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
+    var block = $('.' + e.original_identifier);
     if (e.viewHeight != viewHeight) {
       e.viewHeight = viewHeight;
       e.docHeight = $(document).height();
       e.vPosition = e.original_position.top;
       e.hPosition = e.original_position.left;
-      e.vLength = e.clientHeight;
+      e.blockHeight = block.height();
     }
-    var current_position = $(e).offset();
-    // Track horizontal positioning relative to the viewport and set visibility.
+
+    // Track horizontal positioning relative to the viewport and set position.
+    var current_position = block.offset();
     var hScroll = document.documentElement.scrollLeft || document.body.scrollLeft;
     var vOffset = (document.documentElement.scrollTop || document.body.scrollTop) - e.vPosition;
 
-    var topPosition = 0;
     if (vOffset > 0) {
-      visState = 'visible';
-      $('.' + e.original_identifier).css({visibility: 'hidden'});
       //Don't let the bottom of the block go beneath the document height
-      if ((current_position.top + e.vLength) > e.docHeight) {
-         topPosition = e.docHeight - current_position.top - e.vLength;
+      var topPosition = 0;
+      if ((current_position.top + e.blockHeight) > e.docHeight) {
+         topPosition = block.docHeight - current_position.top - e.blockHeight;
       }
+      block.css({left: -hScroll + e.hPosition + 'px', position: 'fixed', top: topPosition + 'px'});
     }
     else {
-      visState = 'hidden';
-      $('.' + e.original_identifier).css({visibility: 'visible'});
+      block.css({left: e.original_position.left + 'px', position: e.original_css_position, top: e.original_position.top + 'px'});
     }
 
-    $(e).css({left: -hScroll + e.hPosition + 'px', visibility: visState, top: topPosition + 'px'});
-
   }
 
   // Only attach to scrollbars once, even if Drupal.attachBehaviors is called
