I want to call the function on load as well as on resize.
Is there a better way to rewrite this more compactly?
$('.content .right').width($(window).width() - (480));
$(window).resize(function(e) {
$('.content .right').width($(window).width() - (480));
});
You can bind to the
resizeevent alone, and trigger this event automatically upon load:The last
.resize()call will run this code upon load.