Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- html{
- <nav class="nav-bar" role="navigation">
- <div class="nav-hold">
- <a href="#" class="nav-menu" id="nav-menu">☰</a>
- <ul class="nav-list" id="nav">
- <li><a href="#">home</a></li>
- <li><a href="#">features</a></li>
- <li><a href="#">work</a></li>
- <li><a href="#">team</a></li>
- <li><a href="#">contact</a></li>
- </ul>
- </div>
- </nav>
- }
- css{
- make it yourself here contain media quires and other more coding
- }
- js{
- var n='#nav',no='nav-open';
- $('.nav-menu').click(function(){
- if($(n).hasClass(no)){
- var newH=$(n).css('height','auto').height();
- $(n).animate({height:0},300);
- setTimeout(function(){
- $(n).removeClass(no).removeAttr('style');
- },320);
- }else{
- var newH=$(n).css('height','auto').height();
- $(n).height(0).animate({height:newH},300);
- setTimeout(function(){
- $(n).addClass(no).removeAttr('style');
- },320);
- }//else
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement