title: Disable/Enable slider functionality on window resize
body: <p>I am using Swiper slider and I would like to disable it for desktop so the interface looks a little different. </p>
  
  <p>The way I achieved this was to create a onload event listener and and check the screen size to create a new Swiper element.</p>
  
  <pre><code>window.addEventListener("load", toggleSlider);
  function toggleSlider() {
    var w = window.innerWidth;
    var container = document.getElementsByClassName("swiper-container");
    if ( w &lt; 768 ) {
      var mySwiper = new Swiper(container, {
        // Optional parameters
  </code></pre>
  
  <p>What I would like to accomplish is to be able to toggle this functionality on windows resize without having to reload the page.
  Something like:</p>
  
  <pre><code> if ( w &lt; 768 ) {
      var mySwiper = new Swiper(...
   }else{
    delete Swiper
   }
  </code></pre>
  
  <p>I tried deleting the Object <code>Swiper</code>, since the code create a <code>new Swiper()</code>, but it didn't work.</p>
  
  <p>Any Ideas on how it can be accomplished?</p>