jquery - my responsive menu doesn't work in mobile devices -


i made responsive menu-bar collapsed in screen max-width=850 pixel. working correctly in desktop different sizes. doesn't work in mobile devices.

        $(document).ready(function(){      			$(".showmenu").click(function(){      				$(".objs").slidetoggle("slow");      			});      		});
        #menu{      	background-color: gray;      	height: 50px;      }        .obj{      	display: inline-block;          background-color: wheat;          margin: 2px;          width: 100px;          text-align: center;          height: 26px;          border:0;      }        .showmenu {      	display: none;          height: 100%;          background-color: inherit;          border: 0;          color: black;          outline: 0;      }      @media screen , (min-width: 850px){      	.objs{      		display: block !important;      	}      	.obj{      		display: inline-block !important;      	}      	.showmenu{      		display: none;      	}        }      @media screen , (max-width: 850px){      	.objs{      		display: none;      		width: 100%;      		background-color: wheat;      	}      	.obj{      		width: 90%;      	}      	.showmenu{      		display: block;      	}        }
<!doctype html>  <html>  <head>  	<title>responsive menu</title>  	<link rel="stylesheet" type="text/css" href="menu.css">  	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>    </head>  <body>  	<div id="menu">  		<button class="showmenu">menu</button>  		<div class="objs">  			<button class="obj">1</button>  			<button class="obj">2</button>  			<button class="obj">3</button>  			<button class="obj">4</button>  			<button class="obj">5</button>  			<button class="obj">6</button>	  		</div>  	</div>  </body>  </html>

just add below coded header tag of html

<meta name="viewport" content="width=device-width, initial-scale=1"> 

Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -