JSFiddle - React, Tailwind, and code Playground
JavaScript
//bind to resize handler and then trigger resize once after
$(window).resize(function() {
var width = $(window).width();
var windowWidth = 1600 - width;
if(width < 1600) {
$('.image-carousel > ul').css({'left': -windowWidth / 2, 'position': 'absolute'});
} else {
$('.image-carousel > ul').css({'left': 0, 'position': 'relative'});
}
}).resize();