I tried to tweak this example to work in the way that fixed div is aligneg to bottom of the screen until you scroll by it's parent's bottom line where it should stuck when scrolling to further down. Tweaking with no good results so I'm asking here how it is supposed to be done?
Stop jQuery fixed position scrolling when bottom of scrolling element reaches end of parent element