javascript - Swiper.js - Uncaught TypeError: Cannot read property 'params' of null -
i'm using swiper.js , once swiper1.destroy(); run, rebuild, slide slide , click.
i got error of swiper.js:438 uncaught typeerror: cannot read property 'params' of null
here's code. appreciate helps. thank much.
$('.call').click(function(e){ e.preventdefault() $("#menu").addclass("hide"); $("#slider").removeclass("hide"); selector.push("address"); var swiper1 = new swiper('.swiper1', { pagination: '.one', paginationclickable: true, hashnav: true, loop:true, initialslide:0 }); getlocation(); $('.noclick').click(function(e){ e.preventdefault() swiper1.unlockswipes(); // <-- seems causing problem swiper1.slideprev(); // <-- seems causing problem player.seekto(0); }) $('.yes').click(function(e){ e.preventdefault() swiper1.unlockswipes(); // <-- seems causing problem swiper1.slidenext(); // <-- seems causing problem }) $('.overlay').click(function(e){ swiper1.unlockswipes(); console.log("overlay"); e.preventdefault() $("#menu").removeclass("hide"); $("#slider").addclass("hide"); swiper1.destroy(); }) swiper1.on('slidechangestart', function () { var dataindex = $(".swiper-slide-active").data('index'); console.log(dataindex); if(dataindex == 8){ onplayerready(); swiper1.lockswipes(); settimeout(function(){ //var state = player.getplayerstate(); //console.log(state); //if (state == 0){ //alert("this should work"); swiper1.unlockswipes(); swiper1.slideto(9); //} },4000); }else if(dataindex == 9) { swiper1.lockswipes(); }else if(dataindex == 10){ swiper1.lockswipes(); }else{ stopvideo(); } }); })
Comments
Post a Comment