How to Build a Custom Left Sidebar Navigation Menu with Submenu using HTML, CSS and JQuery | how to create a responsive navigation menu bar with submenu

1,241 views


Hey guys, today in this post we are going to learn about how to create a custom left sidebar Navigation Menu with Submenu using HTML, CSS and JQuery.

Files we used in this post example:-

sidebarNavigation.html HTML File It is used for create a left sidebar Navigation menu with Submenu on display the browser.

sidebarNavigation.js

JavaScript File It is holding JavaScript click functioality

sidebarNavigation.css

Style CSS File It is used for Navigation menu with Submenu alignment.
jquery-1.7.1.min.js JQuery Library Min File It is a JQuey Library that is provided by JQuery

Live Demo

custom sidebar navigation menu with submenu -- w3web.net

 

You can download file directly from github by Click Here.

Note:: – You will get an email, so put correct email and mobile number and BEGIN YOUR JOURNEY from Today!
   

 

 

Other related post that would you like to learn in Salesforce

 

Download Supported jQuery Library for Navigation Menu

Step 1:- Create HTML File : sidebarNavigation.html

sidebarNavigation.html [HTML File]

  1.   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Left Sidebar Navigation Menu With Submenu</title>
  6. <script type="text/javascript" src="http://w3web.net/wp-includes/js/jquery-1.7.1.min.js"></script>
  7. <script type="text/javascript" src="include/sidebarNavigation.js"></script>
  8. <link rel="stylesheet" href="include/sidebarNavigation.css" type="text/css" media="all">
  9.  
  10. </head>
  11. <body>
  12. <ul class="navMenu">
  13.     <li><a href="#"><span><img src="https://www.w3web.net/wp-content/uploads/2020/08/right_60.png" width="20" height="15"/></span> How to start a blog for free that makes money</a>                        	
  14.          <ul>
  15.             <li><a href="#"><span>Why is your website not showing in google search</a>
  16.                 <ul>                   
  17.                    <li><a href="#">Select your favorite category of blog</a></li>
  18.                     <li><a href="#">Find your relevant domain name</a></li>
  19.                     <li><a href="#">Find a web hosting provider</a></li>
  20.                     <li><a href="#">Setup WordPress to start a blog</a></li>
  21.                     <li><a href="#">Install relevant WordPress theme</a></li>
  22.                     <li><a href="#">How to write content on your blog</a></li>
  23.                     <li><a href="#">How to promote your blog</a></li>
  24.                     <li><a href="#">How to make money from blogging</a></li>
  25.                 </ul>
  26.             </li>
  27.  
  28.             <li><a href="#">Blog Popular Category</a>
  29.                 <ul>
  30.                    <li><a href="#">Personal Blogging</a></li>
  31.                     <li><a href="#">Educational Tutorial</a></li>
  32.                     <li><a href="#">Fitness</a></li>
  33.                     <li><a href="#">Media</a></li>
  34.                     <li><a href="#">Real State</a></li>
  35.                     <li><a href="#">Freelancing</a></li>
  36.                     <li><a href="#">Online Business</a></li>
  37.                     <li><a href="#">Your Hobbies</a></li>
  38.                 </ul>
  39.             </li>
  40.             <li><a href="#">Important Plugins</a>
  41.                 <ul>
  42.                     <li><a href="#">Yoast SEO</a></li>
  43.                     <li><a href="#">Akismet</a></li>
  44.                     <li><a href="#">Visitor Traffic</a></li>
  45.                     <li><a href="#">Ninja Forms</a></li>
  46.                     <li><a href="#">Crayon Syntax Highlighter</a></li>
  47.                 </ul>
  48.             </li>
  49.             <li><a href="#">Ways to Promote a Blog</a>
  50.                 <ul>                                    	
  51.                     <li><a href="#">Submit your blog to search engine</a></li>
  52.                     <li><a href="#">Add social media Icon and be active on social networks</a></li>
  53.                     <li><a href="#">Advertising on the web</a></li>
  54.                     <li><a href="#">Tell your friends know about your blog</a></li>
  55.                     <li><a href="#">Get active on relevant blogs</a></li>
  56.                     <li><a href="#">Create a mailing list</a></li>
  57.                 </ul>
  58.             </li>
  59.  
  60.             <li><a href="#">How to make money from blogging</a>
  61.                 <ul>
  62.                      <li><a href="#">Submit your blog to search engine</a></li>
  63.                         <li><a href="#">Add social media Icon and be active on social networks</a></li>
  64.                         <li><a href="#">Advertising on the web</a></li>
  65.                         <li><a href="#">Tell your friends know about your blog</a></li>
  66.                         <li><a href="#">Get active on relevant blogs</a></li>
  67.                         <li><a href="#">Create a mailing list</a></li>
  68.                 </ul>
  69.             </li>
  70.  
  71.         </ul>
  72.     </li>
  73.  
  74.  
  75.  
  76.  
  77.     <li><a href="#"><span><img src="https://www.w3web.net/wp-content/uploads/2020/08/right_60.png" width="20" height="15"/></span> How to do indexing and ranking of your website</a>                        	
  78.          <ul>
  79.            <li><a href="#">Important Plugins</a>
  80.                 <ul>
  81.                     <li><a href="#">Yoast SEO</a></li>
  82.                     <li><a href="#">Akismet</a></li>
  83.                     <li><a href="#">Visitor Traffic</a></li>
  84.                     <li><a href="#">Ninja Forms</a></li>
  85.                     <li><a href="#">Crayon Syntax Highlighter</a></li>
  86.                 </ul>
  87.             </li>
  88.             <li><a href="#">Ways to Promote a Blog</a>
  89.                 <ul>                                    	
  90.                     <li><a href="#">Submit your blog to search engine</a></li>
  91.                     <li><a href="#">Add social media Icon and be active on social networks</a></li>
  92.                     <li><a href="#">Advertising on the web</a></li>
  93.                     <li><a href="#">Tell your friends know about your blog</a></li>
  94.                     <li><a href="#">Get active on relevant blogs</a></li>
  95.                     <li><a href="#">Create a mailing list</a></li>
  96.                 </ul>
  97.             </li>
  98.  
  99.             <li><a href="#">How to make money from blogging</a>
  100.                 <ul>
  101.                      <li><a href="#">Submit your blog to search engine</a></li>
  102.                         <li><a href="#">Add social media Icon and be active on social networks</a></li>
  103.                         <li><a href="#">Advertising on the web</a></li>
  104.                         <li><a href="#">Tell your friends know about your blog</a></li>
  105.                         <li><a href="#">Get active on relevant blogs</a></li>
  106.                         <li><a href="#">Create a mailing list</a></li>
  107.                 </ul>
  108.             </li>
  109.             <li><a href="#">8 Reason why is your website not showing in google search</a>
  110.                 <ul>                   
  111.                    <li><a href="#">Select your favorite category of blog</a></li>
  112.                     <li><a href="#">Find your relevant domain name</a></li>
  113.                     <li><a href="#">Find a web hosting provider</a></li>
  114.                     <li><a href="#">Setup WordPress to start a blog</a></li>
  115.                     <li><a href="#">Install relevant WordPress theme</a></li>
  116.                     <li><a href="#">How to write content on your blog</a></li>
  117.                     <li><a href="#">How to promote your blog</a></li>
  118.                     <li><a href="#">How to make money from blogging</a></li>
  119.                 </ul>
  120.             </li>
  121.  
  122.             <li><a href="#">Blog Popular Category</a>
  123.                 <ul>
  124.                    <li><a href="#">Personal Blogging</a></li>
  125.                     <li><a href="#">Educational Tutorial</a></li>
  126.                     <li><a href="#">Fitness</a></li>
  127.                     <li><a href="#">Media</a></li>
  128.                     <li><a href="#">Real State</a></li>
  129.                     <li><a href="#">Freelancing</a></li>
  130.                     <li><a href="#">Online Business</a></li>
  131.                     <li><a href="#">Your Hobbies</a></li>
  132.                 </ul>
  133.             </li>            
  134.  
  135.         </ul>
  136.     </li>
  137.  
  138.  
  139.  
  140.     <li><a href="#"><span><img src="https://www.w3web.net/wp-content/uploads/2020/08/right_60.png" width="20" height="15"/></span> How to add new sitemap on blogger or website</a>                        	
  141.          <ul>
  142.             <li><a href="#">8 Reason why is your website not showing in google search</a>
  143.                 <ul>                   
  144.                    <li><a href="#">Select your favorite category of blog</a></li>
  145.                     <li><a href="#">Find your relevant domain name</a></li>
  146.                     <li><a href="#">Find a web hosting provider</a></li>
  147.                     <li><a href="#">Setup WordPress to start a blog</a></li>
  148.                     <li><a href="#">Install relevant WordPress theme</a></li>
  149.                     <li><a href="#">How to write content on your blog</a></li>
  150.                     <li><a href="#">How to promote your blog</a></li>
  151.                     <li><a href="#">How to make money from blogging</a></li>
  152.                 </ul>
  153.             </li>
  154.  
  155.             <li><a href="#">Blog Popular Category</a>
  156.                 <ul>
  157.                    <li><a href="#">Personal Blogging</a></li>
  158.                     <li><a href="#">Educational Tutorial</a></li>
  159.                     <li><a href="#">Fitness</a></li>
  160.                     <li><a href="#">Media</a></li>
  161.                     <li><a href="#">Real State</a></li>
  162.                     <li><a href="#">Freelancing</a></li>
  163.                     <li><a href="#">Online Business</a></li>
  164.                     <li><a href="#">Your Hobbies</a></li>
  165.                 </ul>
  166.             </li>
  167.             <li><a href="#">Important Plugins</a>
  168.                 <ul>
  169.                     <li><a href="#">Yoast SEO</a></li>
  170.                     <li><a href="#">Akismet</a></li>
  171.                     <li><a href="#">Visitor Traffic</a></li>
  172.                     <li><a href="#">Ninja Forms</a></li>
  173.                     <li><a href="#">Crayon Syntax Highlighter</a></li>
  174.                 </ul>
  175.             </li>
  176.             <li><a href="#">Ways to Promote a Blog</a>
  177.                 <ul>                                    	
  178.                     <li><a href="#">Submit your blog to search engine</a></li>
  179.                     <li><a href="#">Add social media Icon and be active on social networks</a></li>
  180.                     <li><a href="#">Advertising on the web</a></li>
  181.                     <li><a href="#">Tell your friends know about your blog</a></li>
  182.                     <li><a href="#">Get active on relevant blogs</a></li>
  183.                     <li><a href="#">Create a mailing list</a></li>
  184.                 </ul>
  185.             </li>
  186.  
  187.             <li><a href="#">How to do indexing and ranking of your website</a>
  188.                 <ul>
  189.                      <li><a href="#">Submit your blog to search engine</a></li>
  190.                         <li><a href="#">Add social media Icon and be active on social networks</a></li>
  191.                         <li><a href="#">Advertising on the web</a></li>
  192.                         <li><a href="#">Tell your friends know about your blog</a></li>
  193.                         <li><a href="#">Get active on relevant blogs</a></li>
  194.                         <li><a href="#">Create a mailing list</a></li>
  195.                 </ul>
  196.             </li>
  197.  
  198.         </ul>
  199.     </li>
  200.  
  201. </ul>
  202.  
  203.  <br/>
  204.    <!--Start RelatedTopics Section-->
  205. <div style="border:1px #ddd solid; padding:10px; background:#eee; margin:40px 0;">
  206.  
  207.             <p data-aura-rendered-by="435:0"><img src="https://www.w3web.net/wp-content/uploads/2021/05/thumbsUpLike.png" width="25" height="25" style="vertical-align:top; margin-right:10px;" data-aura-rendered-by="436:0"><strong data-aura-rendered-by="437:0"><span style="font-size:16px; font-style:italic; display:inline-block; margin-right:5px;">Don't forget to check out:-</span><a href="https://www.w3web.net/" target="_blank" rel="noopener noreferrer" style="text-decoration:none;" data-aura-rendered-by="440:0">An easy way to learn step-by-step online free Salesforce tutorial, To know more Click  <span style="color:#ff8000; font-size:18px;" data-aura-rendered-by="442:0">Here..</span></a></strong></p>
  208.  
  209.             <br/><br/>
  210.             <p data-aura-rendered-by="435:0"><img src="https://www.w3web.net/wp-content/uploads/2021/07/tickMarkIcon.png" width="25" height="25" style="vertical-align:top; margin-right:10px;" data-aura-rendered-by="436:0"><strong data-aura-rendered-by="437:0"><span style="font-size:17px; font-style:italic; display:inline-block; margin-right:5px; color:rgb(255 128 0);">You May Also Like β†’</span> </strong></p>
  211.             <div style="display:block; overflow:hidden;"> 
  212.                 <div style="width: 50%; float:left; display:inline-block">
  213.                   <ul style="list-style-type: square; font-size: 16px; margin: 0 0 0 54px; padding: 0;"> 
  214.                         <li><a href="https://www.w3web.net/update-parent-object-from-child/" target="_blank" rel="noopener noreferrer">update parent field from child using apex trigger</a></li>
  215.                         <li><a href="https://www.w3web.net/create-lightning-datatable-row-actions-in-lwc/" target="_blank" rel="noopener noreferrer">how to insert a record of account Using apex class in LWC</a></li>                       
  216.                         <li><a href="https://www.w3web.net/edit-save-and-remove-rows-dynamically-in-lightning-component/" target="_blank" rel="noopener noreferrer">how to edit/save row dynamically in lightning component</a></li>
  217.                          <li><a href="https://www.w3web.net/fetch-picklist-values-dynamic-in-lwc/" target="_blank" rel="noopener noreferrer">how to get picklist values dynamically in lwc</a></li>
  218.                     </ul>
  219.  
  220.             </div>
  221.  
  222.             <div style="width: 50%; float:left; display:inline-block">
  223.                     <ul style="list-style-type: square; font-size: 16px; margin: 0 0 0 54px; padding: 0;"> 
  224.                         <li><a href="https://www.w3web.net/get-selected-radio-button-value-and-checked-default-in-lwc/" target="_blank" rel="noopener noreferrer">how to display selected radio button value in lwc</a></li>
  225.                         <li><a href="https://www.w3web.net/display-account-related-contacts-in-lwc/" target="_blank" rel="noopener noreferrer">how to display account related contacts based on AccountId in lwc</a></li>
  226.                         <li><a href="https://www.w3web.net/create-lightning-datatable-row-actions-in-lwc/" target="_blank" rel="noopener noreferrer">how to create lightning datatable row actions in lwc</a></li>
  227.                         <li><a href="https://www.w3web.net/if-and-else-condition-in-lwc/" target="_blank" rel="noopener noreferrer">how to use if and else condition in lwc</a></li>
  228.  
  229.                     </ul>
  230.                 </div>
  231.                <div style="clear:both;"></div> 
  232.                <br/>
  233.                 <div class="youtubeIcon">
  234.                     <a href="https://www.youtube.com/channel/UCW62gTen2zniILj9xE6LmOg" target="_blank" rel="noopener noreferrer"><img src="https://www.w3web.net/wp-content/uploads/2021/11/youtubeIcon.png" width="25" height="25" style="vertical-align:top; margin-right:10px;"/> <strong>TechW3web:-</strong> To know more, Use this <span style="color: #ff8000; font-weight: bold;">Link</span> </a>
  235.                 </div>
  236.     </div>
  237.  
  238. </div>
  239.  
  240.   <!--End RelatedTopics Section-->
  241. </body>
  242. </html>

 

Step 2:- Create JavaScript File : sidebarNavigation.js

sidebarNavigation.js [JavaScript File]

Note:: – You will get an email, so put correct email and mobile number and BEGIN YOUR JOURNEY from Today!
 
 
  1.   $(document).ready(function(){  
  2.    $('ul.navMenu ul').attr('class',function(){
  3.      $(this).parent('li').find('a:first').attr('rel','firstLabel');
  4. 	 return 'firstLabel';
  5.    })
  6.  
  7.  
  8.    $('ul.navMenu ul ul').attr('class', function(){
  9.      $(this).parent('li').find('a:first').attr('rel','secLabel')
  10. 	 return 'secLabel';
  11.    })
  12.  
  13.  
  14.     var indexFirst = $('ul.navMenu a[rel="firstLabel"]');   
  15.  
  16.  
  17. 		$('ul.navMenu a[rel="firstLabel"]').click(function(){
  18. 			var a1 = indexFirst.index(this);			
  19. 			$('ul.navMenu ul.firstLabel').hide();
  20.             $('ul.navMenu ul.firstLabel:eq(' + a1 + ')').show();          
  21.  
  22. 			$('ul.navMenu a[rel="firstLabel"]').removeClass('active');					
  23. 			$(this).addClass('active');	
  24.  
  25. 		});
  26.  
  27.  
  28. 	var indexSec = $('ul.navMenu ul a[rel="secLabel"]')
  29. 	 $('ul.navMenu ul a[rel="secLabel"]').click(function(){
  30. 	   var a2 = indexSec.index(this)
  31. 	   $('ul.navMenu ul li ul.secLabel').hide();
  32. 		$('ul.navMenu ul li ul.secLabel:eq(' + a2 + ')').show();
  33.  
  34. 		$('ul.navMenu ul a[rel="secLabel"]').removeClass('sel');	
  35. 		$(this).addClass('sel');	   
  36. 	 })   
  37.  
  38. 	 $('ul.secLabel li a').click(function(){
  39. 	   $('ul.secLabel li a').removeClass('sel');
  40. 	   $(this).addClass('sel');
  41. 	 })
  42.  
  43.   })// JavaScript Document

 

Step 3:- Create Style CSS : sidebarNavigation.css

sidebarNavigation.css [Style CSS File]

  1.   ul.navMenu{ margin:0; padding:0 10px 0 10px; list-style:none; width:500px; font-family:Arial, Helvetica, sans-serif;}
  2. ul.navMenu li{ font-size:16px; color:#464646; font-weight:bold; background:#f7f7f7; padding:0 0 20px 10px; position:relative;}
  3. ul.navMenu li a, ul.navMenu li a:visited{ color:#686868; text-decoration:none;}
  4. ul.navMenu li a:hover, ul.navMenu li a.active, ul.navMenu li a.active:visited{ color:#ee8e02; text-decoration:none;}
  5.  
  6. /*ul.navMenu li.active a, ul.navMenu li.active a:visited{ color:#ee8e02; text-decoration:none;}*/
  7.  
  8. ul.navMenu li ul{ margin:0; padding:5px 0 0 15px; list-style:none; display:none;}
  9. ul.navMenu li ul li{ font-size:15px; font-weight:normal; color:#7d7d7d; background:url(https://www.w3web.net/wp-content/uploads/2020/08/dotline.gif) no-repeat left 13px; padding:0 0 0 10px;}
  10.  
  11. ul.navMenu li ul li a{ color:#7d7d7d; text-decoration:none; padding:6px 0 6px 0; display:block;}
  12. ul.navMenu li ul li a:hover, ul.navMenu li ul li a.sel { color:#ee8e02; text-decoration:none;}
  13.  
  14. ul.navMenu li ul li ul{ margin:0; padding:0px 0 0 10px; list-style:none; display:none;}
  15. ul.navMenu li ul li ul li{ font-size:14px; color:#464646; font-weight:normal; background:url(https://www.w3web.net/wp-content/uploads/2020/08/orange_bullet.png) no-repeat left 5px; padding:0 0 3px 12px;}
  16. ul.navMenu li ul li ul li a{color:#7d7d7d; text-decoration:none; padding:2px 0 2px 0; display:block;}
  17. ul.navMenu li ul li ul li a:hover, ul.navMenu li ul li ul li a.sel { color:#ee8e02; text-decoration:none;}

 
custom sidebar navigation menu with submenu -- w3web.net

 
 

Further post that would you like to learn in Salesforce

 
 

 

 

FAQ (Frequently Asked Questions)

What is the navigation menu in Salesforce?

The Navigation Menu component extends your site's navigation beyond navigational topics. Navigation menu items can include Salesforce objects, topics, pages in your site, URLs to external sites, and menu labels. Menu labels are parent headings under which you can nest other menu items.

What is Lightning navigation?

Lightning:navigation is used to navigate to a given pageReference or to generate. a URL from a pageReference.To navigate we need to define a PageReference object. The pageReference type generates a unique URL format and defines attributes that. apply to all pages of that type.

What is utility bar in Salesforce Lightning?

The utility bar is a specialized type of Lightning page that gives your users quick access to common productivity tools, like Notes and Recent Items. It appears as a fixed footer that users can access to open utilities in docked panels. Some utilities support pop-out, which lets them open in a new browser window.

Related Topics | You May Also Like

 
Note:: – You will get an email, so put correct email and mobile number and BEGIN YOUR JOURNEY from Today!
 
 
  

Our Free Courses β†’

πŸ‘‰ Get Free Course β†’

πŸ“Œ Salesforce Administrators

πŸ“Œ Salesforce Lightning Flow Builder

πŸ“Œ Salesforce Record Trigger Flow Builder

πŸ‘‰ Get Free Course β†’

πŸ“Œ Aura Lightning Framework

πŸ“Œ Lightning Web Component (LWC)

πŸ“Œ Rest APIs Integration



Hi, This is Vijay Kumar behind the admin and founder of w3web.net. I am a senior software developer and working in MNC company from more than 8 years. I am great fan of technology, configuration, customization & development. Apart of this, I love to write about Blogging in spare time, Working on Mobile & Web application development, Salesforce lightning, Salesforce LWC and Salesforce Integration development in full time. [Read full bio] | | The Sitemap where you can find all published post on w3web.net

Leave a Comment