I'm very new to jquery and am having a bit of an issue with changing css styles for scroll effects.
I have a div which at the load of the page I want to be fixed to top:75px, but once a user starts to scroll past 75px from top, I want to change it to position:fixed top: 0px.
For now I'm only able to get it to change on any scroll action, not wait till it reaches 75px from top.
My code so far is extremely basic as Im somewhat stuck on this particular part.
$(window).scroll(function () {
$("#side_bar").css("position", "fixed").css("top", "0px");
});
Ideally I'd really like it to be scrollable until the bottom of the #side_bar touches the footer, and then reverse the whole thing when scrolling back up to 75px from the top so that it changes back to position:static, top:75px.
Thanks in advance!