title: Jquery swipe left or right on mobile
body: <p>I want to swipe left or right using jquery mobile. When I click the swipe left it opens the drawer and on right it closes the drawer. Currently I press the upper button and  menu function is used to open menu I want to do it by using swipe function in jquery. Please help</p>
  
  <p>Html Divs:</p>
  
  <pre><code>&lt;div class="DinM-navbar-header "&gt;
          &lt;img src="" data-target=".DinM-navbar-collapse" data-toggle="collapse" class="DinM-navbar-toggle" alt="menu-icon" /&gt;
      &lt;/div&gt;
      &lt;div class=""&gt;
          &lt;%=HTML %&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Javascript function:</p>
  
  <pre><code> function ShowMenu() {
              var mainmenu = $(".DinM-main-menu");
              if (($(window).width() &lt;= 991 &amp;&amp; mainmenu.parent().attr('id') != "mobile")) {
                  $("#main-wrapper").animate({
                      left: "0px"
                  });
                  $("#mobile").html(mainmenu.clone());
                  $(".DinM-main-menu", $(".DinM-top-menu")).remove();
                  $(".DinM-main-menu").css("z-index", "-1").hide();
                  $("#main-wrapper").css("min-height", $(".DinM-main-menu").height());
              } else if ($(window).width() &gt; 992 &amp;&amp; mainmenu.parent().attr('id') == "mobile") {
                  mainmenu.insertAfter($(".DinM-navbar-header "));
                  mainmenu.show();
                  $("#mobile").html('');
              }
  
   $(document).ready(function () {
          $("body").wrapInner("&lt;div id='main-wrapper' class='content-left' &gt;&lt;/div&gt;").append("&lt;div id='mobile' &gt;&lt;/div&gt;");
          $(".DinM-main-menu").removeClass('DinM-hide');
          ShowMenu();
      });
  </code></pre>