How to implement drop down menu using jQuery

0
2566

In this session we will study how to implement drop down menu with the help of jQuery.Here we will create some tabs where each tab will have an drop down list of items .

  • To learn how to implement drop down menu using jQuery follow the steps given below :

  1. First create a new folder say jQuery1 in this folder create an new html file say index.html and also create an image folder that will contain your images that you will use to design the web page.
  2. Thus in your jQuery folder you will have following content :
  3. drop down using jQuery

  4. Open the index.html file in the Notepad++ or any other text editor and write the given code :
  5. Here are the screenshots for the code :
  6. implement drop down in jQuery
    drop down menu in jquery
    how to implement drop down
    drop down in jQuery

  7. The explanation of the code is as follows :
  8. In the head section we have added an hosted jQuery library , you can also download the jQuery from the jQuery.com and create an folder say js and inside that create an file called jquery.js and paste the downloaded code in that file and specify its path .
  9. Or simply you can use a hosted library such as Google and simply include the link .
  10. The slideToggle(400); is an jQuery effect .This will work like a slide when the mouseover i.e hover() event will occur.
  11. You can also use the fadeToggle(300);.In the parenthesis you can pass the millisecond for the event to execute , this will work like a fade effect.
  12. Then we have added css in our page .
  13. Now save the file.
  14. Now run your index.html file and you will have the following output consisting the drop down menus .
  15. drop down menu
    jQuery drop down menu
    how to implement drop down menu
    implementing drop down menu in jQuery

  16. Thus we have learnt how to implement drop down menu using jQuery.

LEAVE A REPLY

Please enter your comment!
Please enter your name here