`$(window).on('resize', resizeCover).trigger('resize');` instead of calling `resizeCover();` initially.