/**
 * Copyright (C) 2013 Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
 * All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * - Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 *
 * - Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

(function () {

  // Retain the value of the original onAdd function
  var originalOnAdd = L.Marker.prototype.onAdd;

  L.Marker.include({

    _toPoint: function (latlng) {
      return this._map.latLngToContainerPoint(latlng);
    },
    _toLatLng: function (point) {
      return this._map.containerPointToLatLng(point);
    },

    _animate: function (opts) {
      var start = new Date();
      var id = setInterval(function () {
        var timePassed = new Date() - start;
        var progress = timePassed / opts.duration;
        if (progress > 1) {
          progress = 1;
        }
        var delta = opts.delta(progress);
        opts.step(delta);
        if (progress === 1) {
          clearInterval(id);
        }
      }, opts.delay || 10);
    },

    _move: function (delta, duration) {
      var to = this._point.y;
      var self = this;

      this._animate({
        delay: 10,
        duration: duration || 1000, // 1 sec by default
        delta: delta,
        step: function (delta) {
          self._drop_point.y = to * delta;
          self.setLatLng(self._toLatLng(self._drop_point));
        }
      });
    },

    // Many thanks to Robert Penner for this function
    _easeOutBounce: function (pos) {
      if ((pos) < (1 / 2.75)) {
        return (7.5625 * pos * pos);
      } else if (pos < (2 / 2.75)) {
        return (7.5625 * (pos -= (1.5 / 2.75)) * pos + 0.75);
      } else if (pos < (2.5 / 2.75)) {
        return (7.5625 * (pos -= (2.25 / 2.75)) * pos + 0.9375);
      } else {
        return (7.5625 * (pos -= (2.625 / 2.75)) * pos + 0.984375);
      }
    },

    bounce: function(duration) {
      this._point = this._toPoint(this._latlng);
      var top_y = this._toPoint(this._map.getBounds()._northEast).y;
      this._drop_point = new L.Point(this._point.x, top_y);
      this._move(this._easeOutBounce, duration);
    },

    onAdd: function (map) {
      originalOnAdd.call(this, map);
      if (typeof this.options.autoBounce === 'undefined' ||
          this.options.autoBounce === true){
          this.bounce();
      }
    }
  });
})();

@@ -2215,18 +2215,27 @@
     var 
+start_poin
 t
-o
  = this.
@@ -2235,23 +2235,78 @@
 = this._
+drop_
 point.y
+,%0A          distance = this._point.y - start_point
 ;%0A      
@@ -2510,18 +2510,39 @@
 y = 
-to
+start_point + (distance
  * delta
 ;%0A  
@@ -2537,16 +2537,17 @@
  * delta
+)
 ;%0A      
@@ -3086,24 +3086,93 @@
   %7D%0A    %7D,%0A%0A
+    // Bounce : if height in pixels is not specified, drop from top.%0A
     bounce: 
@@ -3180,32 +3180,40 @@
 unction(duration
+, height
 ) %7B%0A      this._
@@ -3266,16 +3266,57 @@
  top_y =
+ height === undefined ?%0A                 
  this._t
@@ -3357,16 +3357,59 @@
 hEast).y
+ :%0A                  this._point.y - height
 ;%0A      

Allow to bounce from custom height