   #
   # <button class="js-modal-trigger" data-modal-target="#target">
 
-  $modal = $("<div class='js-modal'>").appendTo('body')
-  $overlay = $('<div class="js-modal__overlay">').appendTo($modal)
+  $modal = $("<div class='js-modal'>")
+  $overlay = $('<div class="js-modal__overlay">')
   $overlay.css {
     display: "none"
     position: "fixed"

    if $currentTarget != null
      $currentTarget.hide()
    $currentTarget = $(target)
    $overlay.show()
    $currentTarget.show()

  $modal.on "hide", (e) ->

    $currentTarget = null


  $(document)
    .on 'click', ".js-modal-trigger", ->
      target = $(this).data("modal-target")
      $modal.trigger("show",target)