diff --git a/js/tooltip.js b/js/tooltip.js
index 6dc6cf2e11799dc5822ea28d5d7f8a07f89363f8..944586a2d07d0391bbb68ee59a0bea2c8d310c8f 100644
--- a/js/tooltip.js
+++ b/js/tooltip.js
@@ -191,10 +191,10 @@
         var $container   = this.options.container ? $(this.options.container) : this.$element.parent()
         var containerDim = this.getPosition($container)
 
-        placement = placement == 'bottom' && pos.bottom   + actualHeight  > containerDim.bottom  ? 'top'    :
-                    placement == 'top'    && pos.top      - actualHeight  < containerDim.top     ? 'bottom' :
-                    placement == 'right'  && pos.right    + actualWidth   > containerDim.width   ? 'left'   :
-                    placement == 'left'   && pos.left     - actualWidth   < containerDim.left    ? 'right'  :
+        placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top'    :
+                    placement == 'top'    && pos.top    - actualHeight < containerDim.top    ? 'bottom' :
+                    placement == 'right'  && pos.right  + actualWidth  > containerDim.width  ? 'left'   :
+                    placement == 'left'   && pos.left   - actualWidth  < containerDim.left   ? 'right'  :
                     placement
 
         $tip