Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to show dropdownlist below menu About us but i dont know how to implement this code

i just try to learning about html a few day but this issue itry many day to add please show thx lady and gettlement


<section class="menu-section">
       <div class="container">
           <div class="row ">
               <div class="col-md-12">
                   <div class="navbar-collapse collapse ">
                       <ul id="menu-top" class="nav navbar-nav navbar-right">
                           <li><a href="index.html" class="menu-top-active" >HOME</a></li>


                         <li><a href="about.html">ABOUT US</a></li>
                           <li><a href="contact.html">CONTACT</a></li>
                           <li><a href="http://www.jcythailand.com/jcy" target = "blank">Service</a></li>
                       </ul>
                   </div>
               </div>

           </div>
       </div>
   </section>
Posted
Comments
Peter Leow 14-Mar-15 5:47am    
You mean a sub menu that appear and disappear on click?

1 solution

Put the sub menu items into a separate ul, and use jQuery to toggle this ul on click event. E.g.
XML
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $(".aboutus").click(function(){
        $(".aboutusitem").toggle();
    });
});
</script>
</head>
<body>
<ul class="menu">
<li>Others</li>
<li class="aboutus">ABOUT US</li>
    <ul class="aboutusitem">
         <li><a href="contact.html">CONTACT</a></li>
         <li><a href="http://www.jcythailand.com/jcy" target = "blank">Service</a>               </li>
   </ul>
</il>
</ul>
</body>
</html>

Read more: jQuery toggle() Method[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900