title: bxSlider, destroy the slider if screen is wider than X
body: <p>I'm trying to use jQuery bxSlider only when the screen is small, for mobile devices. So I'm calling this function and the first part of the if/else statement works, but not the second "else" where I try to destroy the slider:</p>
  
  <pre><code>$(window).on("resize", function (e) {
          checkScreenSize();
      });
  
      checkScreenSize();
  
      function checkScreenSize(){
  
          var slider = $(".thumbnails-custom-list").bxSlider();
  
          var newWindowWidth = $(window).width();
          if (newWindowWidth &lt; 481) {
  
              $(".thumbnails-custom-list").bxSlider();
  
          } else {
               $(".thumbnails-custom-list").bxSlider().destroySlider();
          }
  
      }
  </code></pre>
  
  <p>I get a console error:</p>
  
  <p>".destroySlider is not a function"</p>