While researching about above mention questions, I came up with solution which did not work in my case.
MutationObserver and Resize Observer
var observer = new MutationObserver(function (mutations) {
$parent.find('.ListSliderWrapper').removeClass('binded');
let carousel = new CarouselInit($parent.find('.ListSliderWrapper'));
});
observer.observe($parent.find('.ListSliderWrapper')[0], {
attributes: true,
attributeFilter: ['class']
});
The above mention code went into infinite loop.
function observeSize() {
$parent.find('.ListSliderWrapper').removeClass('binded');
let carousel = new CarouselInit($parent.find('.ListSliderWrapper'));
}
new ResizeObserver(observeSize).observe($('.ListSliderWrapper')[0])
This code works only on google chrome.
I am searching the way to track the width change of an element by class with cross browser compatibility.