Create a function that only fires once when the image goes over / under the given width, and create and destroy the swiper accordingly
jQuery(function($) {
var fired = [false, false],
mySwiper;
$(window).on('resize', function() {
if ( $(this).width() > 670 && !fired[0]) {
fired[0] = true;
fired[1] = false;
mySwiper = $('.swiper-container').swiper({
mode:'horizontal',
loop: true,
grabCursor: true,
paginationClickable: true
});
}else if ($(this).width() < 670 && !fired[1]) {
fired[0] = false;
fired[1] = true;
mySwiper.destroy();
}
});
});