Trigger an event after adding a class in jquery

Viewed 348

I have a slider and it's automatically changing the contents.

<div class="main-slider">
  <div class="slide slide-active" data-num="1"> <img> </div>
  <div class="slide"  data-num="1"> <img> </div>
  <div class="slide" data-num="2"> <img> </div>
  <div class="slide"  data-num="3"> <img> </div>
</div>

Here when slider is working this slide-active class is automatically changed to next slide .

What I need is, I need to trigger an event when slide active class is changed . For example I need to alert the corresponding data-num value of active slide.

How I can do this ?

2 Answers
Related