This might be hard to explain but say my browser size is small like in image 1. The bottom text is positioned where it should be and when I scroll down a script activates.
EDIT https://jsfiddle.net/j4f53rds/1/
function fixDiv() {
var $div = $("#nav_color");
var top = $div.data("top");
if ($(window).scrollTop() > top) {
$('#nav_color').css({'position': 'fixed', 'top': '0px'});
}
else {
$('#nav_color').css({'position': 'absolute', 'top' : top + 'px'});
}
}
$("#nav_color").data("top", $("#nav_color").offset().top);
$(window).scroll(fixDiv);
The script causes the text on the bottom to become fixed on the top of the html as the user scrolls down. Now here comes the issue. After firing, if I resize the browser, say make it full screen, like in image two, and then scroll back up. The text doesn't reposition to it's would be new location, it resets back to the original position in the smaller browser. How do I get the script to take into account a new browser size when the user scrolls back up?

