Reputation: 32331
I have a Menu and i am clciking on it using the line
$("#swipecontainer .swiper-slide").eq(centervalue).trigger("click");
But i see that never the event listener is getting fired .
This is my code
$(document).on("click", ".swiper-slide", function() {
alert('i am called');
});
http://jsfiddle.net/cod7ceho/61/
Could you please let me know how to resolve this .
Upvotes: 0
Views: 52
Reputation: 82241
You need to define the event before making the call to it.
$(document).on("click", ".swiper-slide", function() {
alert('i am called');
});
$("#swipecontainer").append(favoriteresultag).trigger("create");
$("#swipecontainer .swiper-slide").eq(centervalue).trigger("click");
Upvotes: 1