I’m looking to have this only happen once and not every time the third slide is equal to the current slide. How would i do that? would .once() work for this?
var currentSlide = current - 1;
var firstSlide = $('#slide1').index();
var secondSlide = $('#slide2').index();
var thirdSlide = $('#slide3').index();
if (thirdSlide == currentSlide) {
$('img.joyceAnim').flipbook({
'end': 4,
'loop': false,
'fps': 8,
'mobileStep': 1,
'images': 'anim/bench/%d.png'
});
}
Just make a switch to see if you should do it.