 
     _hide_scroll: (elem = "body") ->
       if @config.disable_page_scroll
-        $(elem).css({ overflow: "hidden", "padding-right": @_get_scrollbar_width })
+        $(elem).css({ overflow: "hidden", "padding-right": @_get_scrollbar_width(elem) })
 
     _show_scroll: (elem = "body") ->
       if @config.disable_page_scroll

  class AjaxPopup
    defaults:
      style: "center"
      width: 200
      height: 200

      animation_popup: "opacity"
      animation_overlay: "opacity"
      animation_duration: 400
      animation_easing: "easeOutCubic"

      disable_page_scroll: true
      hide_on_click_overlay: true

    _toggle_popup: ->
      animations = {
        opacity: [ { opacity: 0 }, { opacity: 1 } ],
        left: [ { left: "-#{@config.width}" }, { left: 0 } ],
        right: [ { right: "-#{@config.width}" }, { right: 0 } ],
        top: [{ top: "-#{@config.height}" }, { top: 0 } ],
        bottom: [{ bottom: "-#{@config.height}" }, { bottom: 0 } ]
      }
      animation_popup = animations[@config.animation_popup] || @config.animation_popup
      animation_overlay = animations[@config.animation_overlay] || @config.animation_overlay
