 
       preload = new Image()
       preload.onload = ->
-        $(image).after templates['image-hover'].replace '{{cid}}', cid
+        image.insertAdjacentHTML 'afterend', templates['image-hover'].replace '{{cid}}', cid
 
         popover = document.querySelector "[data-pid=\"#{cid}\"]"
         setStyle popover,

    for ev in event
      target.addEventListener ev, listener, false

hasClassList = (element, selector) ->
  target = getTarget element, selector
  if target? and target.hasOwnProperty 'classList'

          'margin-top': "#{-1 * image.offsetHeight}px"

        addHandler image, ['mouseenter', 'mouseleave'], ->
          toggleClass popover, 'choco-hover'

        addHandler popover, 'click', (event) ->
          showFirstImage event, cid

      preload.src = data.thumbnail
