   _getInitialParams: ->
     thumbnails = if not @options.thumbnails then false else $(@thumbnails).height()
 
-    horizontal = toInt($(@overlay).css('padding-left')) + toInt($(@overlay).css('padding-right'))
-    vertical   = toInt($(@overlay).css('padding-top')) + toInt($(@overlay).css('padding-bottom'))
-
-    header = toInt $(@header).css('height')
+    css = getStyle @overlay
+    horizontal = toInt(css 'padding-left') + toInt(css 'padding-right')
+    vertical   = toInt(css 'padding-top') + toInt(css 'padding-bottom')
+
+    header = toInt getStyle(@header)('height')
     if header is 0
       header = 40
       $(@header).css 'height', header

  if target.hasOwnProperty 'classList'
    target.classList.contains className


toInt = (string) -> parseInt string, 10


  _outerWidth: (element) ->
    return element.outerWidth true if element.outerWidth?

    css = getStyle element

    styles = [
      'margin-left'
