How to hide a drawer menu by dragging?

-1

So I'm starting to develop websites and I made a drawer style menu of google play for the mobile version of the site only that it does not hide when dragging it to the side does anyone know a way to make this interaction?     

asked by anonymous 28.03.2017 / 22:10

1 answer

1

You need to use jquery mobile to make this menu, because it's native, you can not get the swipeleft and swiperight

The link to download jquery mobile is: link and you can choose only the functions you want to download, in this case, Touch functions. Just select the checkbox with this option as it will select all its dependencies.

After doing this, apply the following code:

//para abrir o menu    
$(window).on("swiperight",function(e){
  //estilo do menu aberto
});

//para fechar o menu    
$(window).on("swipeleft",function(e){
  //estilo do menu fechado
});
    
28.03.2017 / 22:42