Utilizing Unslider in a recent project from .
Managed to align the slider halfway, but facing an issue with off-center slides on resolutions of 1920px and lower. The image width is 3940px.
Attempted to implement the code snippet from this answer like so:
$(function () {
$('.banner').unslider();
AdjustSliderImgWrapper();
});
$(window).resize(AdjustSliderImgWrapper);
function AdjustSliderImgWrapper() {
var left = (parseInt($('.banner > li > img').width()) - $('.banner > li').innerWidth()) / -2;
$('.banner > li > img').css('left', left);
}
However, no success. Also tried:
$(".banner img").each(function () {
$(this).css("margin-left", -this.width / 2);
})
and:
background-position: center center !important;
Here's the code snippet: