 toInt = (string) -> parseInt string, 10
 
 cssAnimationsSupport = ->
-  return true if $('html').hasClass 'cssanimations'
+  return true if hasClass document.querySelector('html'), 'cssanimations'
 
   support = false
   element = document.createElement 'div'

                         .replace('{{image}}', image.thumbnail)
                         .replace('{{title}}', if image.title then ' title="' + image.title + '"' else '')

    @thumbnails.html(content).find('.choco-thumbnail').each ->
      thumbnail = $ @
      image = thumbnail.attr 'data-image'


          @images[cid].width  = element.width
          @images[cid].height = element.height

          addClass @spinner, 'choco-hide'

          fn()

      element.onerror = =>
        if cid is @current
          addClass @spinner, 'choco-hide'
          addClass @container, 'choco-show'
          addClass @container, 'choco-error'
          @updateDimensions $(@container).width(), $(@container).height()

      element.src = image.source

