I work with cordova and jquery, and i try to use Swiper by idangero.
I tried to do this :
$(document).ready(function () { //initialize swiper when document ready var mySwiper = new Swiper ('.swiper-container', { // Optional parameters autoplay: ‘3000’, loop: true }) }); but when i call it in this part:
$(document).on('pagebeforeshow', ‘#listDetail’, function(){ … some codes … if(row.pictures != ''){ var numslide = mySwiper.slides.length; mySwiper.appendSlide(slidecontent); for (var i = 0; i < numslide; i++) { mySwiper.removeSlide(0); } mySwiper.updateSlidesSize(); }else{ mySwiper.removeAllSlides(); } … some codes … }); i have this Uncaught ReferenceError: mySwiper is not defined message.
Any idea?
Thank you