Calculate position for Affix bottom

added positionbottom as Option-Value for affix()

so it is possible to calculate the css-bottom-value.
Example:
    var $document = $(document);
    var $Affixparent = $("#ProductDetails");
        
    // side bar
    $('#affixtocart').affix({
      offset: {
        top: function() { return  $Affixparent.offset().top; },
        bottom: function() { return $Affixparent.offset().top + $Affixparent.height()/2; }
      },
        positionbottom : function() {
            return parseInt($document.height() - ($Affixparent.offset().top + $Affixparent.height())); 
        } 
      }

CSS:
body {position: relative}
.affix { position: fixed; top: 40px} 
.affix-bottom { position: absolute} 

other css-positions not needed