javascript - js doesnot get applied to appended html -
i having slick slide effect on divs using .js file shown below.
<div id="thumblist" class="lazy slider"> <div> <img /> </div> <div> <img /> </div> </div>
so, on initial load applies slide effect images. after call ajax , append data in 'thumblist' div, shows html .js effect doesn't apllied it. how solve issue?
i solved issue. reinitialize of script required. @ same time first have destroy slick effect , whole data apply slick.
$(".lazy").slick('unslick'); ..... append data ..... $(".lazy").slick({ lazyload: 'ondemand', // ondemand progressive anticipated infinite: true, slidestoshow: 1, arrows: false, slidestoscroll: 1, autoplay: true, autoplayspeed: 2000, });
Comments
Post a Comment