I juste want to change the background color based on the scroll. Red to blue for exemple...
This code works but how can I change the grey to a color ?
ht
$(document).ready(function(){ var scroll_pos = 0; $(document).scroll(function() { scroll_pos = $(this).scrollTop(); if(scroll_pos > 210) { $("body").css('background-color', 'blue'); } else { $("body").css('background-color', 'red'); } }); });