window.resize event only fires once
This only gets called once since the document.ready is consumed on the page load.
$(document).ready(function(){
window.resize(alert("yolo"));
});
You would need to attach an event handler to the window
window.onresize = function() { alert("yolo"); };
or
$(window).resize(function () {alert("yolo");});