Skip to main content
se añadieron 103 caracteres en el cuerpo
Origen Enlace
Marcos Martínez
  • 2.3k
  • 1
  • 13
  • 21
$('li').hover(
        function(){
            $(this).children('ul').slideDown(800);
        },
        function(){
            $(this).children('ul').slideUp(800);
        }
    );
    
$('#mostrar-nav').on('click',function(){
    $('nav').toggleClass('mostrar');
})
body{
    background-color: #252528;
    padding: 0 1em;
    color: rgba(255,255,255,.4);
}

.menu{
    list-style: none;
    line-height: 42px;
    padding-left: 0px;
    width: 15em;
    margin: 2em auto;
}

.menu a{
    color: #ddd;
    text-decoration: none;
    text-transform: uppercase;
    display: block;
    width: 100%;
}

.menu a:hover{
    margin-left: 1em;
    --webkit-transition: all .5;
    -o-transition: all .5;
    transition: all .5;
}
.menu li{
    box-shadow: 3px 0 rgba(255,255,255,.2) inset;
    margin-bottom: 5px;
    padding-left: 1.5em;
    --webkit-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
}

.menu li:hover{
    box-shadow: 15em 0 rgba(255,255,255,.2) inset;
}



ul,ol{
    list-style: none;
}
nav{
    position: absolute;
    left: -18em;
    z-index: 20;
    background-color: rgba(0,0,0,.8);
    height: 100%;
    top: 0;
    padding-right: .25em;
    padding-top: 3em;
    transition: all .5s;
    box-sizing: border-box;
}

nav.mostrar{
    left: 0;
}


#mostrar-nav{
    background: url(https://www.google.com.mx/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwievJbtx-DWAhVBF2MKHRFjC4QQjRwIBw&url=https%3A%2F%2Ficons8.com%2Ficon%2F17551%2Ftop-menu&psig=AOvVaw3Hz6QlP7BvIPG84vpsQOkF&ust=1507536125997991);
    left: 2em;
    height: 40px;
    position: absolute;
    top: 2em;
    width: 40px;
    z-index: 30;
    cursor: pointer;
}

h1{
    text-align: right;
    color: rgba(255,255,255,.7);
    font-size: 1.5em;
    margin-bottom: 1em;
}

article{
    padding:.5em 0;
}
<!DOCTYPE html>
<html>
<head>
    <title>menu</title>
    <link rel="stylesheet" type="text/css" href="menu.css">
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>

</head>
<body>
    <div id="mostrar-nav"></div>
    <nav class="mostrar">
        <ul class="menu">
            <li><a href="#">menu1</a>
                <ul>
                    <li><a href="#">submenu1</a></li>
                    <li><a href="#">submenu2</a></li>
                    <li><a href="#">submenu3</a>
            <ul>
                            <li><a href="#">subsubmenu1</a></li>
                            <li><a href="#">subsubmenu2</a></li>
                            <li><a href="#">subsubmenu3</a></li>
                            <li><a href="#">subsubmenu4</a></li>
                        </ul>
           </li>
                    <li><a href="#">submenu4</a></li>
                </ul>
      </li>
            <li><a href="#">menu2</a></li>
            <li><a href="#">menu3</a></li>
            <li><a href="#">menu4</a></li>
            <li><a href="#">menu5</a></li>
            <li><a href="#">menu6</a></li>
        </ul>
    </nav>
    <header>
        <h1>prueba de menu</h1>
    </header>

    <article>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </article>
    <footer>
    </footer>
</body>
</html>
$('li').hover(
        function(){
            $(this).children('ul').slideDown(800);
        },
        function(){
            $(this).children('ul').slideUp(800);
        }
    );
body{
    background-color: #252528;
    padding: 0 1em;
    color: rgba(255,255,255,.4);
}

.menu{
    list-style: none;
    line-height: 42px;
    padding-left: 0px;
    width: 15em;
    margin: 2em auto;
}

.menu a{
    color: #ddd;
    text-decoration: none;
    text-transform: uppercase;
    display: block;
    width: 100%;
}

.menu a:hover{
    margin-left: 1em;
    --webkit-transition: all .5;
    -o-transition: all .5;
    transition: all .5;
}
.menu li{
    box-shadow: 3px 0 rgba(255,255,255,.2) inset;
    margin-bottom: 5px;
    padding-left: 1.5em;
    --webkit-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
}

.menu li:hover{
    box-shadow: 15em 0 rgba(255,255,255,.2) inset;
}



ul,ol{
    list-style: none;
}
nav{
    position: absolute;
    left: -18em;
    z-index: 20;
    background-color: rgba(0,0,0,.8);
    height: 100%;
    top: 0;
    padding-right: .25em;
    padding-top: 3em;
    transition: all .5s;
    box-sizing: border-box;
}

nav.mostrar{
    left: 0;
}


#mostrar-nav{
    background: url(https://www.google.com.mx/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwievJbtx-DWAhVBF2MKHRFjC4QQjRwIBw&url=https%3A%2F%2Ficons8.com%2Ficon%2F17551%2Ftop-menu&psig=AOvVaw3Hz6QlP7BvIPG84vpsQOkF&ust=1507536125997991);
    left: 2em;
    height: 40px;
    position: absolute;
    top: 2em;
    width: 40px;
    z-index: 30;
    cursor: pointer;
}

h1{
    text-align: right;
    color: rgba(255,255,255,.7);
    font-size: 1.5em;
    margin-bottom: 1em;
}

article{
    padding:.5em 0;
}
<!DOCTYPE html>
<html>
<head>
    <title>menu</title>
    <link rel="stylesheet" type="text/css" href="menu.css">
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>

</head>
<body>
    <div id="mostrar-nav"></div>
    <nav class="mostrar">
        <ul class="menu">
            <li><a href="#">menu1</a>
                <ul>
                    <li><a href="#">submenu1</a></li>
                    <li><a href="#">submenu2</a></li>
                    <li><a href="#">submenu3</a>
            <ul>
                            <li><a href="#">subsubmenu1</a></li>
                            <li><a href="#">subsubmenu2</a></li>
                            <li><a href="#">subsubmenu3</a></li>
                            <li><a href="#">subsubmenu4</a></li>
                        </ul>
           </li>
                    <li><a href="#">submenu4</a></li>
                </ul>
      </li>
            <li><a href="#">menu2</a></li>
            <li><a href="#">menu3</a></li>
            <li><a href="#">menu4</a></li>
            <li><a href="#">menu5</a></li>
            <li><a href="#">menu6</a></li>
        </ul>
    </nav>
    <header>
        <h1>prueba de menu</h1>
    </header>

    <article>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </article>
    <footer>
    </footer>
</body>
</html>
$('li').hover(
        function(){
            $(this).children('ul').slideDown(800);
        },
        function(){
            $(this).children('ul').slideUp(800);
        }
    );
    
$('#mostrar-nav').on('click',function(){
    $('nav').toggleClass('mostrar');
})
body{
    background-color: #252528;
    padding: 0 1em;
    color: rgba(255,255,255,.4);
}

.menu{
    list-style: none;
    line-height: 42px;
    padding-left: 0px;
    width: 15em;
    margin: 2em auto;
}

.menu a{
    color: #ddd;
    text-decoration: none;
    text-transform: uppercase;
    display: block;
    width: 100%;
}

.menu a:hover{
    margin-left: 1em;
    --webkit-transition: all .5;
    -o-transition: all .5;
    transition: all .5;
}
.menu li{
    box-shadow: 3px 0 rgba(255,255,255,.2) inset;
    margin-bottom: 5px;
    padding-left: 1.5em;
    --webkit-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
}

.menu li:hover{
    box-shadow: 15em 0 rgba(255,255,255,.2) inset;
}



ul,ol{
    list-style: none;
}
nav{
    position: absolute;
    left: -18em;
    z-index: 20;
    background-color: rgba(0,0,0,.8);
    height: 100%;
    top: 0;
    padding-right: .25em;
    padding-top: 3em;
    transition: all .5s;
    box-sizing: border-box;
}

nav.mostrar{
    left: 0;
}


#mostrar-nav{
    background: url(https://www.google.com.mx/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwievJbtx-DWAhVBF2MKHRFjC4QQjRwIBw&url=https%3A%2F%2Ficons8.com%2Ficon%2F17551%2Ftop-menu&psig=AOvVaw3Hz6QlP7BvIPG84vpsQOkF&ust=1507536125997991);
    left: 2em;
    height: 40px;
    position: absolute;
    top: 2em;
    width: 40px;
    z-index: 30;
    cursor: pointer;
}

h1{
    text-align: right;
    color: rgba(255,255,255,.7);
    font-size: 1.5em;
    margin-bottom: 1em;
}

article{
    padding:.5em 0;
}
<!DOCTYPE html>
<html>
<head>
    <title>menu</title>
    <link rel="stylesheet" type="text/css" href="menu.css">
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>

</head>
<body>
    <div id="mostrar-nav"></div>
    <nav class="mostrar">
        <ul class="menu">
            <li><a href="#">menu1</a>
                <ul>
                    <li><a href="#">submenu1</a></li>
                    <li><a href="#">submenu2</a></li>
                    <li><a href="#">submenu3</a>
            <ul>
                            <li><a href="#">subsubmenu1</a></li>
                            <li><a href="#">subsubmenu2</a></li>
                            <li><a href="#">subsubmenu3</a></li>
                            <li><a href="#">subsubmenu4</a></li>
                        </ul>
           </li>
                    <li><a href="#">submenu4</a></li>
                </ul>
      </li>
            <li><a href="#">menu2</a></li>
            <li><a href="#">menu3</a></li>
            <li><a href="#">menu4</a></li>
            <li><a href="#">menu5</a></li>
            <li><a href="#">menu6</a></li>
        </ul>
    </nav>
    <header>
        <h1>prueba de menu</h1>
    </header>

    <article>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </article>
    <footer>
    </footer>
</body>
</html>
se añadieron 19 caracteres en el cuerpo
Origen Enlace
Marcos Martínez
  • 2.3k
  • 1
  • 13
  • 21
$('li').hover(
        function(){
            $(this).children('ul').slideDown(800);
        },
        function(){
            $(this).children('ul').slideUp(800);
        }
    );
body{
    background-color: #252528;
    padding: 0 1em;
    color: rgba(255,255,255,.4);
}

.menu{
    list-style: none;
    line-height: 42px;
    padding-left: 0px;
    width: 15em;
    margin: 2em auto;
}

.menu a{
    color: #ddd;
    text-decoration: none;
    text-transform: uppercase;
    display: block;
    width: 100%;
}

.menu a:hover{
    margin-left: 1em;
    --webkit-transition: all .5;
    -o-transition: all .5;
    transition: all .5;
}
.menu li{
    box-shadow: 3px 0 rgba(255,255,255,.2) inset;
    margin-bottom: 5px;
    padding-left: 1.5em;
    --webkit-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
}

.menu li:hover{
    box-shadow: 15em 0 rgba(255,255,255,.2) inset;
}



ul,ol{
    list-style: none;
}
nav{
    position: absolute;
    left: -18em;
    z-index: 20;
    background-color: rgba(0,0,0,.8);
    height: 100%;
    top: 0;
    padding-right: .25em;
    padding-top: 3em;
    transition: all .5s;
    box-sizing: border-box;
}

nav.mostrar{
    left: 0;
}


#mostrar-nav{
    background: url(https://www.google.com.mx/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwievJbtx-DWAhVBF2MKHRFjC4QQjRwIBw&url=https%3A%2F%2Ficons8.com%2Ficon%2F17551%2Ftop-menu&psig=AOvVaw3Hz6QlP7BvIPG84vpsQOkF&ust=1507536125997991);
    left: 2em;
    height: 40px;
    position: absolute;
    top: 2em;
    width: 40px;
    z-index: 30;
    cursor: pointer;
}

h1{
    text-align: right;
    color: rgba(255,255,255,.7);
    font-size: 1.5em;
    margin-bottom: 1em;
}

article{
    padding:.5em 0;
}
<!DOCTYPE html>
<html>
<head>
    <title>menu</title>
    <link rel="stylesheet" type="text/css" href="menu.css">
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>

</head>
<body>
    <div id="mostrar-nav"></div>
    <nav class="mostrar">
        <ul class="menu">
            <li><a href="#">menu1</a>
                <ul>
                    <li><a href="#">submenu1</a></li>
                    <li><a href="#">submenu2</a></li>
                    <li><a href="#">submenu3</a>
             <ul>
                            <li><a href="#">subsubmenu1</a></li>
                            <li><a href="#">subsubmenu2</a></li>
                            <li><a href="#">subsubmenu3</a></li>
                            <li><a href="#">subsubmenu4</a></li>
                        </ul>
           </li>
                        
                    <li><a href="#">submenu4</a></li>
                </ul>
      </li>
            <li><a href="#">menu2</a></li>
            <li><a href="#">menu3</a></li>
            <li><a href="#">menu4</a></li>
            <li><a href="#">menu5</a></li>
            <li><a href="#">menu6</a></li>
        </ul>
    </nav>
    <header>
        <h1>prueba de menu</h1>
    </header>

    <article>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </article>
    <footer>
    </footer>
</body>
</html>
$('li').hover(
        function(){
            $(this).children('ul').slideDown(800);
        },
        function(){
            $(this).children('ul').slideUp(800);
        }
    );
body{
    background-color: #252528;
    padding: 0 1em;
    color: rgba(255,255,255,.4);
}

.menu{
    list-style: none;
    line-height: 42px;
    padding-left: 0px;
    width: 15em;
    margin: 2em auto;
}

.menu a{
    color: #ddd;
    text-decoration: none;
    text-transform: uppercase;
    display: block;
    width: 100%;
}

.menu a:hover{
    margin-left: 1em;
    --webkit-transition: all .5;
    -o-transition: all .5;
    transition: all .5;
}
.menu li{
    box-shadow: 3px 0 rgba(255,255,255,.2) inset;
    margin-bottom: 5px;
    padding-left: 1.5em;
    --webkit-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
}

.menu li:hover{
    box-shadow: 15em 0 rgba(255,255,255,.2) inset;
}



ul,ol{
    list-style: none;
}
nav{
    position: absolute;
    left: -18em;
    z-index: 20;
    background-color: rgba(0,0,0,.8);
    height: 100%;
    top: 0;
    padding-right: .25em;
    padding-top: 3em;
    transition: all .5s;
    box-sizing: border-box;
}

nav.mostrar{
    left: 0;
}


#mostrar-nav{
    background: url(https://www.google.com.mx/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwievJbtx-DWAhVBF2MKHRFjC4QQjRwIBw&url=https%3A%2F%2Ficons8.com%2Ficon%2F17551%2Ftop-menu&psig=AOvVaw3Hz6QlP7BvIPG84vpsQOkF&ust=1507536125997991);
    left: 2em;
    height: 40px;
    position: absolute;
    top: 2em;
    width: 40px;
    z-index: 30;
    cursor: pointer;
}

h1{
    text-align: right;
    color: rgba(255,255,255,.7);
    font-size: 1.5em;
    margin-bottom: 1em;
}

article{
    padding:.5em 0;
}
<!DOCTYPE html>
<html>
<head>
    <title>menu</title>
    <link rel="stylesheet" type="text/css" href="menu.css">
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>

</head>
<body>
    <div id="mostrar-nav"></div>
    <nav class="mostrar">
        <ul class="menu">
            <li><a href="#">menu1</a>
                <ul>
                    <li><a href="#">submenu1</a></li>
                    <li><a href="#">submenu2</a></li>
                    <li><a href="#">submenu3</a>
             <ul>
                            <li><a href="#">subsubmenu1</a></li>
                            <li><a href="#">subsubmenu2</a></li>
                            <li><a href="#">subsubmenu3</a></li>
                            <li><a href="#">subsubmenu4</a></li>
                        </ul>
          </li>
                        
                    <li><a href="#">submenu4</a></li>
                </ul>
      </li>
            <li><a href="#">menu2</a></li>
            <li><a href="#">menu3</a></li>
            <li><a href="#">menu4</a></li>
            <li><a href="#">menu5</a></li>
            <li><a href="#">menu6</a></li>
        </ul>
    </nav>
    <header>
        <h1>prueba de menu</h1>
    </header>

    <article>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </article>
    <footer>
    </footer>
</body>
</html>
$('li').hover(
        function(){
            $(this).children('ul').slideDown(800);
        },
        function(){
            $(this).children('ul').slideUp(800);
        }
    );
body{
    background-color: #252528;
    padding: 0 1em;
    color: rgba(255,255,255,.4);
}

.menu{
    list-style: none;
    line-height: 42px;
    padding-left: 0px;
    width: 15em;
    margin: 2em auto;
}

.menu a{
    color: #ddd;
    text-decoration: none;
    text-transform: uppercase;
    display: block;
    width: 100%;
}

.menu a:hover{
    margin-left: 1em;
    --webkit-transition: all .5;
    -o-transition: all .5;
    transition: all .5;
}
.menu li{
    box-shadow: 3px 0 rgba(255,255,255,.2) inset;
    margin-bottom: 5px;
    padding-left: 1.5em;
    --webkit-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
}

.menu li:hover{
    box-shadow: 15em 0 rgba(255,255,255,.2) inset;
}



ul,ol{
    list-style: none;
}
nav{
    position: absolute;
    left: -18em;
    z-index: 20;
    background-color: rgba(0,0,0,.8);
    height: 100%;
    top: 0;
    padding-right: .25em;
    padding-top: 3em;
    transition: all .5s;
    box-sizing: border-box;
}

nav.mostrar{
    left: 0;
}


#mostrar-nav{
    background: url(https://www.google.com.mx/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwievJbtx-DWAhVBF2MKHRFjC4QQjRwIBw&url=https%3A%2F%2Ficons8.com%2Ficon%2F17551%2Ftop-menu&psig=AOvVaw3Hz6QlP7BvIPG84vpsQOkF&ust=1507536125997991);
    left: 2em;
    height: 40px;
    position: absolute;
    top: 2em;
    width: 40px;
    z-index: 30;
    cursor: pointer;
}

h1{
    text-align: right;
    color: rgba(255,255,255,.7);
    font-size: 1.5em;
    margin-bottom: 1em;
}

article{
    padding:.5em 0;
}
<!DOCTYPE html>
<html>
<head>
    <title>menu</title>
    <link rel="stylesheet" type="text/css" href="menu.css">
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>

</head>
<body>
    <div id="mostrar-nav"></div>
    <nav class="mostrar">
        <ul class="menu">
            <li><a href="#">menu1</a>
                <ul>
                    <li><a href="#">submenu1</a></li>
                    <li><a href="#">submenu2</a></li>
                    <li><a href="#">submenu3</a>
            <ul>
                            <li><a href="#">subsubmenu1</a></li>
                            <li><a href="#">subsubmenu2</a></li>
                            <li><a href="#">subsubmenu3</a></li>
                            <li><a href="#">subsubmenu4</a></li>
                        </ul>
           </li>
                    <li><a href="#">submenu4</a></li>
                </ul>
      </li>
            <li><a href="#">menu2</a></li>
            <li><a href="#">menu3</a></li>
            <li><a href="#">menu4</a></li>
            <li><a href="#">menu5</a></li>
            <li><a href="#">menu6</a></li>
        </ul>
    </nav>
    <header>
        <h1>prueba de menu</h1>
    </header>

    <article>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </article>
    <footer>
    </footer>
</body>
</html>
Origen Enlace
Marcos Martínez
  • 2.3k
  • 1
  • 13
  • 21

Colocando los menus y submenus de manera jerárquica (uno dentro del otro, como hijos y no como hermanos) lo hace más sencillo.

Cada li puede contener hijos ul que corresponden a los submenu de ese item:

<li> A
    <ul>
          <li> A.1
                <ul> 
                    <li>A.1.1</li>
                </ul>
           </li> 
     </ul>
</li>

por lo tanto detectando los eventosmouseenter y mouseleave de los li puedes hacer aparecer y desaparecer sus hijos ul según corresponda

Probar utilizando full screen:

$('li').hover(
        function(){
            $(this).children('ul').slideDown(800);
        },
        function(){
            $(this).children('ul').slideUp(800);
        }
    );
body{
    background-color: #252528;
    padding: 0 1em;
    color: rgba(255,255,255,.4);
}

.menu{
    list-style: none;
    line-height: 42px;
    padding-left: 0px;
    width: 15em;
    margin: 2em auto;
}

.menu a{
    color: #ddd;
    text-decoration: none;
    text-transform: uppercase;
    display: block;
    width: 100%;
}

.menu a:hover{
    margin-left: 1em;
    --webkit-transition: all .5;
    -o-transition: all .5;
    transition: all .5;
}
.menu li{
    box-shadow: 3px 0 rgba(255,255,255,.2) inset;
    margin-bottom: 5px;
    padding-left: 1.5em;
    --webkit-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
}

.menu li:hover{
    box-shadow: 15em 0 rgba(255,255,255,.2) inset;
}



ul,ol{
    list-style: none;
}
nav{
    position: absolute;
    left: -18em;
    z-index: 20;
    background-color: rgba(0,0,0,.8);
    height: 100%;
    top: 0;
    padding-right: .25em;
    padding-top: 3em;
    transition: all .5s;
    box-sizing: border-box;
}

nav.mostrar{
    left: 0;
}


#mostrar-nav{
    background: url(https://www.google.com.mx/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwievJbtx-DWAhVBF2MKHRFjC4QQjRwIBw&url=https%3A%2F%2Ficons8.com%2Ficon%2F17551%2Ftop-menu&psig=AOvVaw3Hz6QlP7BvIPG84vpsQOkF&ust=1507536125997991);
    left: 2em;
    height: 40px;
    position: absolute;
    top: 2em;
    width: 40px;
    z-index: 30;
    cursor: pointer;
}

h1{
    text-align: right;
    color: rgba(255,255,255,.7);
    font-size: 1.5em;
    margin-bottom: 1em;
}

article{
    padding:.5em 0;
}
<!DOCTYPE html>
<html>
<head>
    <title>menu</title>
    <link rel="stylesheet" type="text/css" href="menu.css">
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>

</head>
<body>
    <div id="mostrar-nav"></div>
    <nav class="mostrar">
        <ul class="menu">
            <li><a href="#">menu1</a>
                <ul>
                    <li><a href="#">submenu1</a></li>
                    <li><a href="#">submenu2</a></li>
                    <li><a href="#">submenu3</a>
             <ul>
                            <li><a href="#">subsubmenu1</a></li>
                            <li><a href="#">subsubmenu2</a></li>
                            <li><a href="#">subsubmenu3</a></li>
                            <li><a href="#">subsubmenu4</a></li>
                        </ul>
          </li>
                        
                    <li><a href="#">submenu4</a></li>
                </ul>
      </li>
            <li><a href="#">menu2</a></li>
            <li><a href="#">menu3</a></li>
            <li><a href="#">menu4</a></li>
            <li><a href="#">menu5</a></li>
            <li><a href="#">menu6</a></li>
        </ul>
    </nav>
    <header>
        <h1>prueba de menu</h1>
    </header>

    <article>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </article>
    <footer>
    </footer>
</body>
</html>