   scrollOffset: (orig) ->
     # just assume scroll will always try to go to a position that causes sticky to show.
     # TODO: don't assume.
-    stickyHeight = if @sticky[0]? then @sticky[0].getBoundingClientRect().height else 0
+    stickyHeight = if @pinnedSticky[0]? then @pinnedSticky[0].getBoundingClientRect().height else 0
     Math.max(0, orig - @headerHeight() - stickyHeight)
 
 

  constructor: ->
    @header = document.getElementsByClassName('js-pinned-header')
    @marker = document.getElementsByClassName('js-sticky-header')
    @sticky = document.getElementsByClassName('js-pinned-header-sticky')
    @stickyBreadcrumbs = document.getElementsByClassName('js-sticky-header-breadcrumbs')
    @stickyContent = document.getElementsByClassName('js-sticky-header-content')



    @visible = visible
    if visible
      Fade.in @pinnedSticky[0]
    else
      Fade.out @pinnedSticky[0]

    $(document).trigger 'sticky-header:sticking', [visible]

