public/js/pipe.js
function positionFromTop(container, el){
    
    var containerTop = container.position().top
      , windowTop = $window.scrollTop()
    if(containerTop > windowTop) return el.css('top', 0)
      
    var pos = windowTop - containerTop
    
    return el.css('top', pos)
    
    
  }
function positionFromTop(container, el){
    
    var containerTop = container.position().top
      , windowTop = $window.scrollTop()
    if(containerTop > windowTop) return el.css('top', 0)
      
    var pos = windowTop - containerTop
    
    return el.css('top', pos)
    
    
  }
function positionFromTop ( container , el ) { var containerTop = container . position ( ) . top , windowTop = $window . scrollTop ( ) if ( containerTop > windowTop ) return el . css ( 'top' , 0 ) var pos = windowTop - containerTop return el . css ( 'top' , pos ) }
Position via offset
Position via offset