Skip to main content

Responsive header menu bar using jquery with sub-menu for mobile and tables

Responsive menu jquery with submenu mobile and tables

Responsive header menu bar using jquery with sub-menu for mobile and tables


Download HTML File

Source :


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive menu jquery with submenu mobile and tables </title>
<link rel="stylesheet" href="http://fontawesome.io/assets/font-awesome/css/font-awesome.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(e) {
    $("#mobileMen").click(function(){
$("#menu").fadeToggle(100)
})
});
</script>
<style>
*
{
margin:0px;
padding:0px;
text-decoration:none;
color:inherit;
font-family:arial;
transition-duration:.5s;
}
 nav
 {
background:#FF404E;
    background: -webkit-linear-gradient(#FF404E, #FF616C);
    background: -o-linear-gradient(#FF404E, #FF616C);
    background: -moz-linear-gradient(#FF404E, #FF616C);
    background: linear-gradient(#FF404E, #FF616C);
height:50px;
overflow:hidden;
 }
 .siteArea
{
max-width:1200px;
margin:auto;
display:block;
}
 nav ul#menu
 {
height:50px;
float:left;
 }
 nav ul#menu  li
 {
height:50px;
float:left;
color:#DAECF3;
list-style:none;
letter-spacing:1px;

 }
  nav ul#menu  li:hover
 {
background:#FF616C;
    background: -webkit-linear-gradient(#FF616C, #FF404E); /* For Safari 5.1 to 6.0 */
    background: -o-linear-gradient(#FF616C, #FF404E); /* For Opera 11.1 to 12.0 */
    background: -moz-linear-gradient(#FF616C, #FF404E); /* For Firefox 3.6 to 15 */
    background: linear-gradient(#FF616C, #FF404E); /* Standard syntax */
 }
  nav ul#menu li a
  {
line-height:50px;
padding:0 20px;
display:block;
  }

  nav ul#menu ul
  {
  position:absolute;
  top:50px;
  width:200px;
  overflow:hidden;
  display:none;
  background:#000000;
  background: -webkit-linear-gradient(#FF616C, #FF404E); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(#FF616C, #FF404E); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(#FF616C, #FF404E); /* For Firefox 3.6 to 15 */
background: linear-gradient(#FF616C, #FF404E); /* Standard syntax */
  }
  nav ul#menu  li:hover> ul
  {
  display:block;
  }
  nav ul#menu ul li
  {
  float:left;
  clear:both;
  width:100%;
  padding:0 10px;
  line-height:40px;
  }

  #gnav
  {
  float:right;
  }
  #gnav li
  {
  float:left;
  line-height:30px;
  width:30px;
  height:30px;
  margin:10px;
  background:#DAECF3;
  text-align:center;
  display:block;
   color:#FF404E;
  }
  #mobileMen
{
height:50px;
width:50px;
text-align:center;
line-height:50px;
display:none;
float:left;
}
@media (max-width: 844px){
nav ul#menu
{
height:auto;
float:left;
position:absolute;
top:50px;
width:100%;
background:#012D41;
}
nav ul#menu ul
{
display:block;
position:relative;
clear:both;
top:0px;
background:none;
left:0px;
width:100%;
padding:0px;
}
nav ul#menu li
{
clear:both;
height:auto;
width:100%;
}
nav ul#menu li a, nav ul#menu li ul li a
{
border-bottom:1px solid #FFFFFF;
width:auto;
padding:0px 20px;
}
  nav ul#menu li:hover
  {
  background:none;
  }
nav ul#menu li ul li
{
height:50px;
width:100%;
margin-left:-10px;
border-bottom:1px solid #FFFFFF;
}

#mobileMen
{
height:50px;
width:50px;
text-align:center;
line-height:50px;
display:block;
background:#012D41;
color:#FFFFFF;
font-size:26px;
}
}
</style>
</head>
<body>
<nav>
<div class="siteArea">
    <div id="mobileMen"><i class="fa fa-bars"></i></div>
<ul id="menu">
    <li><a href="#"><i class="fa fa-home"></i></a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Services</a>
            <ul>
            <li><a href="#">Service 1</a></li>
                <li><a href="#">Service 2</a></li>
            </ul>
        </li>
        <li><a href="#">Products</a>     
            <ul>
            <li><a href="#">pro 1</a></li>
                <li><a href="#">pro 2</a></li>
            </ul>     
        </li>
        <li><a href="#">Web design</a></li>
        <li><a href="#">Development</a></li>
    </ul>
 
    <ul id="gnav">
    <li><a href="#"><i class="fa fa-facebook"></i></a></li>
        <li><a href="#"><i class="fa fa-twitter"></i></a></li>
        <li><a href="#"><i class="fa fa-youtube"></i></a></li>
        <li><a href="#"><i class="fa fa-skype"></i></a></li>
    </ul>
    </div>
</nav>
</body>
</html>

Comments

Popular posts from this blog

Data units and bits and bytes

Data units and bits and bytes A bit is smallest unit in data, 1 bit = one binary digit 0 or 1 For Processing or virtual 1 bit = One binary digit (0 or 1) 1 nibble = 4 bit 1 byte = 8 bit 1024  bytes = 1 KB (Kilobyte) 1024 KB = 1 MB (Megabyte) 1024 MB = 1 GB (Gigabyte) 1024 GB = 1 TB (Terabyte) 1024 TB = 1 PB (Petabyte) 1024 PB = 1 EB (Exabyte) 1024 EB = 1 ZB (Zettabyte) 1024 ZB = 1 YB (Yottabyte) 1024 YB = 1 BB (Brontobyte) 1024 BB = 1 GB (Geopbyte) For Storage 1 bit = One binary digit (0 or 1) 1 nibble = 4 bit 1 byte = 8 bit 1000 bytes = 1 KB (Kilobyte) 1000 KB = 1 MB (Megabyte) 1000 MB = 1 GB (Gigabyte) ...

MYSQLI DELETE table data using Parameters Prepared Statements (PHP)

Select and delete data from MySQL table using PHP help of  Parameters Prepared Statements. The output will be this. Source of  the Main page: <?php @$conn = mysqli_connect('localhost','root','','testdb') or die("Please check your database username and password") ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Insert into table</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <style> #myform { margin:20px; -webkit-box-shadow: 0px ...

MYSQLI INSERT INTO table using Parameters Prepared Statements (PHP)

Insert data into mysql table using PHP help of  Parameters Prepared Statements. Why use parameters in your php applications? This is secure This is error less Faster then any others Source : <?php @$conn = mysqli_connect('localhost','root','','testdb') or die("Please check your database username and password") ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Insert into table</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <style> #myfo...