Reposition Div text when div is scrolled based on the visisble viewport of the div

Reposition Div text when div is scrolled based on the visisble viewport of the div

Is it possible to reposition the text inside a div which has scroll and recalculate the the position of the text based on the visible section .
eg: the  text needs to appear 100px; from left or text -align:left but once the div scroll the text doesn't move.I have tried using the within viewport plugin of jquery  and reposition with css("left","100px") ;