Answer the question
In order to leave comments, you need to log in
How to track class change?
Good afternoon, there is such a problem, with such markup
<div class='wrapper'>
<div class='item'>
<div class='item'>
<div class='item active'>
<div class='item'>
</div>
Answer the question
In order to leave comments, you need to log in
This can be tracked using MutationObserver .
But I would look for an opportunity to cling to the code that this class changes.
var mc = new Hammer(document.body);
mc.on("swipe" , function(){
$('.wrapper .item').each(function(k, v){
if($(v).hasClass('active'))
console.log(k)
})
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question