Bootstrap Community, frontend Development

I am writing a jQuery script that uses (and therefore needs) the active slide, as it changes.

'var centerVideo = function() {

$('#full_slider .carousel-item').each(function(){

if ($(this).hasClass('active')) {

var $carouselItem = $(this);

var $itemVideo = $carouselItem.find('video');

var leftMargin = ($itemVideo.width() - $carouselItem.width())/2;

$itemVideo.css('margin-left', -leftMargin);

}

});

}'

How can I target it with jQuery or plain JavaScript?

Ajax30 () - 5 years ago - Reply 0