moving en element when the window is scrolled
I have a rightBar that i whan it to scroll together with all the rest element s of the document. but when it is starting to cover it has to slide down so we can see it all the time.
I tried
-
$(function(){
function positionRightBar(){
if($("#rightBar").scrollTop()<0){
$("#rightBar").scrollTop(0);
}
}
});
but it seems that the scrolltop of the rightbar stays 0 even when it is coverd