Skip to content Skip to sidebar Skip to footer

How Do I Make

Hi I need something that will make the nav contents slide out from the left when the div class 'bt-menu' is pressed. It also needs to slide back in to the left when the div is clic

Solution 1:

the simplest way is:

$(".bt-menu").click(function(){  $("nav").slideToggle(); });

I edit the code you can check it work.

$(document).ready(function(){
  
$(".bt-menu").click(function(){  $("nav").slideToggle(); });

  });
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><header><divclass="menu_bar"><ahref="#"class="bt-menu"><spanclass="icon-menu"></span>Menu</a></div><nav><ul><li><ahref="#">Home</a></li><liclass="submenu" ><ahref="#">Nielsen Products<spanclass="icon-arrow-down2"></span><spanclass="caret"></span></a><ulclass="children"><li><ahref="#">Exterior Cleaning<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Interior Cleaning<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Odour Control & Air Fresheners<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Exterior Finishes<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Dressings<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Glass Cleaning<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Workshop Maintenance<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Janitorial<spanclass="icon-dot-single"></span></a></li><li><ahref="#">TDS & SDS INFO<spanclass="icon-dot-single"></span></a></li></ul></li><li><ahref="#">Nielsen Catalogue</a></li><liclass="submenu"><ahref="#">Equipment/Tools/Consumables<spanclass="icon-arrow-down2"></span><spanclass="caret"></span></a><ulclass="children"><li><ahref="#">Valeting, Brushes and Equipment<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Tools & Equipment<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Workshop Consumables<spanclass="icon-dot-single"></span></a></li><li><ahref="#">AdBlue<spanclass="icon-dot-single"></span></a></li></ul></li><li><ahref="#">Contact Us</a></li><li><ahref="#">About Us</a></li><li><ahref="#">Photo Gallery</a></li></ul></nav></header>
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><script>
$(document).ready(function(){

$(".bt-menu").click(function(){  $("nav").slideToggle(); });

  });
</script><header><divclass="menu_bar"><ahref="#"class="bt-menu"><spanclass="icon-menu"></span>Menu</a></div><nav><ul><li><ahref="#">Home</a></li><liclass="submenu" ><ahref="#">Nielsen Products<spanclass="icon-arrow-down2"></span><spanclass="caret"></span></a><ulclass="children"><li><ahref="#">Exterior Cleaning<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Interior Cleaning<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Odour Control & Air Fresheners<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Exterior Finishes<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Dressings<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Glass Cleaning<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Workshop Maintenance<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Janitorial<spanclass="icon-dot-single"></span></a></li><li><ahref="#">TDS & SDS INFO<spanclass="icon-dot-single"></span></a></li></ul></li><li><ahref="#">Nielsen Catalogue</a></li><liclass="submenu"><ahref="#">Equipment/Tools/Consumables<spanclass="icon-arrow-down2"></span><spanclass="caret"></span></a><ulclass="children"><li><ahref="#">Valeting, Brushes and Equipment<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Tools & Equipment<spanclass="icon-dot-single"></span></a></li><li><ahref="#">Workshop Consumables<spanclass="icon-dot-single"></span></a></li><li><ahref="#">AdBlue<spanclass="icon-dot-single"></span></a></li></ul></li><li><ahref="#">Contact Us</a></li><li><ahref="#">About Us</a></li><li><ahref="#">Photo Gallery</a></li></ul></nav></header>

Post a Comment for "How Do I Make