javascript - Add class and then fire an event JQuery -
i trying add class , fire event, unfortunately not working , think trying in wrong way, can please suggest? following codes
first want add class
$(".hospital_listing_front").addclass('flexslider-hospital');
once class added fire following function (this related flexslider , add flexslider functionality)
$(".flexslider-hospital").flexslider({ animation: "slide", animationloop: false, itemwidth: 210, itemmargin: 48, pauseplay: false });
add class working flexslider not working
please suggest how handle this.
thanks in advance
i thought may have provide time add class. may use settimeout solve problem try , let me know if face again same issue.
$(".hospital_listing_front").addclass('flexslider-hospital'); settimeout(function() { $(".flexslider-hospital").flexslider({ animation: "slide", animationloop: false, itemwidth: 210, itemmargin: 48, pauseplay: false }); }, 1000);
Comments
Post a Comment