hello m I am trying to apply some javascript function to the center element in my owl carousel, the function is working fine on the desktop website because the user can change the center item by clicking on another, but on the phone the user does not have to click on each item, he will prefer to drag the carousel. on drag, the center item is changing but the javascript function does not apply unless the user clicks on the centered item. here is my javascript code:
$(document).ready(function() {
var MyDiv1 = document.querySelector('.center> .small-container-Elections');
//some code applied here
});
Shouldnt the center element be automatically selected when changed? why would the user have to tap on it to be reselected?