(function($) {
  $.declare('floater', {
    defaults: {
      topPadding: 0,
      stopPoint: -1,
      startPoint: -1,
      relative: false,
      offsetX: 0,
      offsetY: 0,
      debug: false
    },

    init: function() {
      this.enabled = true;
      this.height = this.el.outerHeight(true);
      this.resetStyles = {
        position: this.el.css('position'),
        top: this.el.css('top'),
        left: this.el.css('left'),
        width: this.el.css('width')
      };

      var offset = this.el.offset();
      this.startPoint = this.startPoint == -1 ? (offset.top - parseInt(this.topPadding, 10)) : this.startPoint;

      if (typeof this.stopPoint == 'object' && this.stopPoint.length) {
        this.stopPoint = this.stopPoint.offset().top;
      }

      this.floating = false;
      $(window).on('scroll', this.proxy(this.onScroll));
      this.onScroll();
      if (this.debug) {
        this.showDebug();
      }
    },

    setStartPoint: function(point) {
      this.startPoint = point;
    },

    setStopPoint: function(point) {
      this.stopPoint = point;
    },

    showDebug: function() {
      var showLine = function(top) {
        $('<div/>').css({
          position: 'absolute',
          height: '1px',
          width: '100%',
          background: 'red',
          top: top 
        }).appendTo('body');
      };
      showLine(this.startPoint);
      showLine(this.stopPoint);
    },

    createPlaceholder: function() {
      var classes = this.el[0].className || '';
      return $('<div/>')
        .addClass('floater-placeholder ' + classes)
        .css({ 
          width: this.el.css('width'),
          height: this.el.css('height'),
          visibility: 'hidden'
        });
    },

    startFloat: function() {
      if (this.floating) {
        return;
      }
      this.floating = true;
      var offset = this.el.offset();
      this.el.before(this.createPlaceholder());
      this.el.css({
        position: 'fixed',
        top: this.topPadding,
        left: offset.left + this.offsetX,
        width: this.el.css('width')
      });
      this.emit('floatStart');
    },

    stopFloat: function(y) {
      if (!this.floating) {
        return;
      }
      this.floating = false;
      this.el.prev().remove();
      this.el.css({
        position: (y) ? 'absolute' : '',
        top: y || '',
        left: '',
        width: (y) ? this.el.css('width') : ''
      });
      this.emit('floatStop');
    },

    onScroll: function(e) {
      if (!this.enabled) {
        return;
      }
      var scrollY = $(window).scrollTop();
      if (scrollY > this.startPoint) {
        if (this.stopPoint != -1 && (scrollY + this.height) > this.stopPoint) {
          if (this.floating) {
            this.stopFloat(this.stopPoint - this.height);
          }
        } else if (!this.floating) {
          this.startFloat();
        }
      } else if (this.floating && scrollY < this.startPoint) { //top of screen
        this.stopFloat();
      }
    },

    on: function() {
      this.enabled = true;
      this.onScroll();
    },

    off: function() {
      this.stopFloat();
      this.enabled = false;
    }
  });

})(window.jQuery || window.Zepto);

@@ -253,55 +253,8 @@
 ue;%0A
-      this.height = this.el.outerHeight(true);%0A
     
@@ -462,32 +462,87 @@
 is.el.offset();%0A
+      this.topPadding = parseInt(this.topPadding, 10);%0A
       this.start
@@ -587,25 +587,16 @@
 t.top - 
-parseInt(
 this.top
@@ -602,21 +602,16 @@
 pPadding
-, 10)
 ) : this
@@ -622,16 +622,63 @@
 rtPoint;
+%0A      this.height = this.el.outerHeight(true);
 %0A%0A      
@@ -1909,32 +1909,95 @@
 is.el.offset();%0A
+      if (!this.el.prev().hasClass('floater-placeholder')) %7B%0A  
       this.el.be
@@ -2024,24 +2024,32 @@
 eholder());%0A
+      %7D%0A
       this.e
@@ -2111,16 +2111,23 @@
 pPadding
+ + 'px'
 ,%0A      
@@ -2430,28 +2430,273 @@
 on: 
-(y) ? 'absolute' : '
+'',%0A        top: '',%0A        left: '',%0A        width: '' %0A      %7D);%0A      this.emit('floatStop');%0A    %7D,%0A%0A    freezeFloat: function(y) %7B%0A      if (!this.floating) %7B%0A        return;%0A      %7D%0A      this.floating = false;%0A      this.el.css(%7B%0A        position: 'absolute
 ',%0A 
@@ -2708,22 +2708,16 @@
   top: y
- %7C%7C ''
 ,%0A      
@@ -2746,14 +2746,8 @@
 dth:
- (y) ?
  thi
@@ -2767,13 +2767,8 @@
 th')
- : ''
 %0A   
@@ -2796,32 +2796,33 @@
 t('floatStop');%0A
+%0A
     %7D,%0A%0A    onSc
@@ -3032,16 +3032,34 @@
 s.height
+ + this.topPadding
 ) %3E this
@@ -3116,28 +3116,30 @@
        this.
-stop
+freeze
 Float(this.s

fix for topPadding and added freezeFloat method