   close = (options) ->
     $tooltip = $('.up-tooltip')
     if $tooltip.length
-      options = u.options(options, animation: 'fade-out')
+      options = u.options(options, animation: config.closeAnimation)
       options = u.merge(options, up.motion.animateOptions(options))
       up.destroy($tooltip, options)
 

  attach = (linkOrSelector, options = {}) ->
    $link = $(linkOrSelector)
    html = u.option(options.html, $link.attr('up-tooltip-html'))
    text = u.option(options.text, $link.attr('up-tooltip'), $link.attr('title'))
    position = u.option(options.position, $link.attr('up-position'), 'top')
    animation = u.option(options.animation, u.castedAttr($link, 'up-animation'), 'fade-in')
    animateOptions = up.motion.animateOptions(options, $link)
    close()
    $tooltip = createElement(text: text, html: html)

  # Close the tooltip when the user presses ESC.
  up.magic.onEscape(-> close())

  # The framework is reset between tests
  up.on 'up:framework:reset', reset

  attach: attach
  close: close
  open: -> u.error('up.tooltip.open no longer exists. Use up.tooltip.attach instead.')
