I have this piece of code:
$(document).on("click", "#breadNavMain", function() {
for(var i = 0; i < getActiveSlides().length; i++) {
$("#studentWrapper").trigger("click");
}
});
The method getActiveSlides() will return the slides (as an array) currently activated for my application. What's import is that I am getting the number of slides that are active. For anything over 1 active slide, the loop above does not work. If I have 3 active slides (for example), it will only call the .trigger() method once. Within my click handler, if I instead use:
$("#studentWrapper").trigger("click");
$("#studentWrapper").trigger("click");
$("#studentWrapper").trigger("click");
It will work just fine. The problem is that I don't know how many times I'll need to call the .trigger() method so I am unable to do this manually. I wanted to call it inside of a loop like I tried to above. Is there anyway to get .trigger() to work inside of a loop?
getActiveSlides().lengthis returning something? Maybe add analert(getActiveSlides().length)before the loop and see what it says.