javascript - Fix position element on scroll and remove when reaches the end of parent -


i have similar problem question

and here's jsfiddle i'm following .

the problem have sticky element should not fixed position default, unlike 1 on jsfiddle.

#thefixed {  background-color:red;  border: solid;  position:fixed;  top:250px; } 

i want achieve similar effect site . when scroll left side of page fixed , when reaches end of parent element, goes it's original state.

i think scroll magic useful.