In this example, I'm trying to get my if statement using .css to work both on .ready AND .resize but I don't understand how to combine them.
var windowsize = $(window).width();
$(window).ready(function() {
windowsize = $(window).width();
if (windowsize > 440) {
$('body').css("background-color", "blue");
}
else {
$('body').css("background-color", "red");
}
});
Any help?