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
You can download file directly from github by Click Here.
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]
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Left Sidebar Navigation Menu With Submenu</title>
<script type="text/javascript" src="http://w3web.net/wp-includes/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="include/sidebarNavigation.js"></script>
<link rel="stylesheet" href="include/sidebarNavigation.css" type="text/css" media="all">
</head>
<body>
<ul class="navMenu">
<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>
<ul>
<li><a href="#"><span>Why is your website not showing in google search</a>
<ul>
<li><a href="#">Select your favorite category of blog</a></li>
<li><a href="#">Find your relevant domain name</a></li>
<li><a href="#">Find a web hosting provider</a></li>
<li><a href="#">Setup WordPress to start a blog</a></li>
<li><a href="#">Install relevant WordPress theme</a></li>
<li><a href="#">How to write content on your blog</a></li>
<li><a href="#">How to promote your blog</a></li>
<li><a href="#">How to make money from blogging</a></li>
</ul>
</li>
<li><a href="#">Blog Popular Category</a>
<ul>
<li><a href="#">Personal Blogging</a></li>
<li><a href="#">Educational Tutorial</a></li>
<li><a href="#">Fitness</a></li>
<li><a href="#">Media</a></li>
<li><a href="#">Real State</a></li>
<li><a href="#">Freelancing</a></li>
<li><a href="#">Online Business</a></li>
<li><a href="#">Your Hobbies</a></li>
</ul>
</li>
<li><a href="#">Important Plugins</a>
<ul>
<li><a href="#">Yoast SEO</a></li>
<li><a href="#">Akismet</a></li>
<li><a href="#">Visitor Traffic</a></li>
<li><a href="#">Ninja Forms</a></li>
<li><a href="#">Crayon Syntax Highlighter</a></li>
</ul>
</li>
<li><a href="#">Ways to Promote a Blog</a>
<ul>
<li><a href="#">Submit your blog to search engine</a></li>
<li><a href="#">Add social media Icon and be active on social networks</a></li>
<li><a href="#">Advertising on the web</a></li>
<li><a href="#">Tell your friends know about your blog</a></li>
<li><a href="#">Get active on relevant blogs</a></li>
<li><a href="#">Create a mailing list</a></li>
</ul>
</li>
<li><a href="#">How to make money from blogging</a>
<ul>
<li><a href="#">Submit your blog to search engine</a></li>
<li><a href="#">Add social media Icon and be active on social networks</a></li>
<li><a href="#">Advertising on the web</a></li>
<li><a href="#">Tell your friends know about your blog</a></li>
<li><a href="#">Get active on relevant blogs</a></li>
<li><a href="#">Create a mailing list</a></li>
</ul>
</li>
</ul>
</li>
<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>
<ul>
<li><a href="#">Important Plugins</a>
<ul>
<li><a href="#">Yoast SEO</a></li>
<li><a href="#">Akismet</a></li>
<li><a href="#">Visitor Traffic</a></li>
<li><a href="#">Ninja Forms</a></li>
<li><a href="#">Crayon Syntax Highlighter</a></li>
</ul>
</li>
<li><a href="#">Ways to Promote a Blog</a>
<ul>
<li><a href="#">Submit your blog to search engine</a></li>
<li><a href="#">Add social media Icon and be active on social networks</a></li>
<li><a href="#">Advertising on the web</a></li>
<li><a href="#">Tell your friends know about your blog</a></li>
<li><a href="#">Get active on relevant blogs</a></li>
<li><a href="#">Create a mailing list</a></li>
</ul>
</li>
<li><a href="#">How to make money from blogging</a>
<ul>
<li><a href="#">Submit your blog to search engine</a></li>
<li><a href="#">Add social media Icon and be active on social networks</a></li>
<li><a href="#">Advertising on the web</a></li>
<li><a href="#">Tell your friends know about your blog</a></li>
<li><a href="#">Get active on relevant blogs</a></li>
<li><a href="#">Create a mailing list</a></li>
</ul>
</li>
<li><a href="#">8 Reason why is your website not showing in google search</a>
<ul>
<li><a href="#">Select your favorite category of blog</a></li>
<li><a href="#">Find your relevant domain name</a></li>
<li><a href="#">Find a web hosting provider</a></li>
<li><a href="#">Setup WordPress to start a blog</a></li>
<li><a href="#">Install relevant WordPress theme</a></li>
<li><a href="#">How to write content on your blog</a></li>
<li><a href="#">How to promote your blog</a></li>
<li><a href="#">How to make money from blogging</a></li>
</ul>
</li>
<li><a href="#">Blog Popular Category</a>
<ul>
<li><a href="#">Personal Blogging</a></li>
<li><a href="#">Educational Tutorial</a></li>
<li><a href="#">Fitness</a></li>
<li><a href="#">Media</a></li>
<li><a href="#">Real State</a></li>
<li><a href="#">Freelancing</a></li>
<li><a href="#">Online Business</a></li>
<li><a href="#">Your Hobbies</a></li>
</ul>
</li>
</ul>
</li>
<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>
<ul>
<li><a href="#">8 Reason why is your website not showing in google search</a>
<ul>
<li><a href="#">Select your favorite category of blog</a></li>
<li><a href="#">Find your relevant domain name</a></li>
<li><a href="#">Find a web hosting provider</a></li>
<li><a href="#">Setup WordPress to start a blog</a></li>
<li><a href="#">Install relevant WordPress theme</a></li>
<li><a href="#">How to write content on your blog</a></li>
<li><a href="#">How to promote your blog</a></li>
<li><a href="#">How to make money from blogging</a></li>
</ul>
</li>
<li><a href="#">Blog Popular Category</a>
<ul>
<li><a href="#">Personal Blogging</a></li>
<li><a href="#">Educational Tutorial</a></li>
<li><a href="#">Fitness</a></li>
<li><a href="#">Media</a></li>
<li><a href="#">Real State</a></li>
<li><a href="#">Freelancing</a></li>
<li><a href="#">Online Business</a></li>
<li><a href="#">Your Hobbies</a></li>
</ul>
</li>
<li><a href="#">Important Plugins</a>
<ul>
<li><a href="#">Yoast SEO</a></li>
<li><a href="#">Akismet</a></li>
<li><a href="#">Visitor Traffic</a></li>
<li><a href="#">Ninja Forms</a></li>
<li><a href="#">Crayon Syntax Highlighter</a></li>
</ul>
</li>
<li><a href="#">Ways to Promote a Blog</a>
<ul>
<li><a href="#">Submit your blog to search engine</a></li>
<li><a href="#">Add social media Icon and be active on social networks</a></li>
<li><a href="#">Advertising on the web</a></li>
<li><a href="#">Tell your friends know about your blog</a></li>
<li><a href="#">Get active on relevant blogs</a></li>
<li><a href="#">Create a mailing list</a></li>
</ul>
</li>
<li><a href="#">How to do indexing and ranking of your website</a>
<ul>
<li><a href="#">Submit your blog to search engine</a></li>
<li><a href="#">Add social media Icon and be active on social networks</a></li>
<li><a href="#">Advertising on the web</a></li>
<li><a href="#">Tell your friends know about your blog</a></li>
<li><a href="#">Get active on relevant blogs</a></li>
<li><a href="#">Create a mailing list</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<br/>
<!--Start RelatedTopics Section-->
<div style="border:1px #ddd solid; padding:10px; background:#eee; margin:40px 0;">
<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>
<br/><br/>
<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>
<div style="display:block; overflow:hidden;">
<div style="width: 50%; float:left; display:inline-block">
<ul style="list-style-type: square; font-size: 16px; margin: 0 0 0 54px; padding: 0;">
<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>
<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>
<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>
<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>
</ul>
</div>
<div style="width: 50%; float:left; display:inline-block">
<ul style="list-style-type: square; font-size: 16px; margin: 0 0 0 54px; padding: 0;">
<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>
<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>
<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>
<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>
</ul>
</div>
<div style="clear:both;"></div>
<br/>
<div class="youtubeIcon">
<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>
</div>
</div>
</div>
<!--End RelatedTopics Section-->
</body>
</html>
Step 2:- Create JavaScript File : sidebarNavigation.js
sidebarNavigation.js [JavaScript File]
|
$(document).ready(function(){
$('ul.navMenu ul').attr('class',function(){
$(this).parent('li').find('a:first').attr('rel','firstLabel');
return 'firstLabel';
})
$('ul.navMenu ul ul').attr('class', function(){
$(this).parent('li').find('a:first').attr('rel','secLabel')
return 'secLabel';
})
var indexFirst = $('ul.navMenu a[rel="firstLabel"]');
$('ul.navMenu a[rel="firstLabel"]').click(function(){
var a1 = indexFirst.index(this);
$('ul.navMenu ul.firstLabel').hide();
$('ul.navMenu ul.firstLabel:eq(' + a1 + ')').show();
$('ul.navMenu a[rel="firstLabel"]').removeClass('active');
$(this).addClass('active');
});
var indexSec = $('ul.navMenu ul a[rel="secLabel"]')
$('ul.navMenu ul a[rel="secLabel"]').click(function(){
var a2 = indexSec.index(this)
$('ul.navMenu ul li ul.secLabel').hide();
$('ul.navMenu ul li ul.secLabel:eq(' + a2 + ')').show();
$('ul.navMenu ul a[rel="secLabel"]').removeClass('sel');
$(this).addClass('sel');
})
$('ul.secLabel li a').click(function(){
$('ul.secLabel li a').removeClass('sel');
$(this).addClass('sel');
})
})// JavaScript Document
Step 3:- Create Style CSS : sidebarNavigation.css
sidebarNavigation.css [Style CSS File]
|
ul.navMenu{ margin:0; padding:0 10px 0 10px; list-style:none; width:500px; font-family:Arial, Helvetica, sans-serif;}
ul.navMenu li{ font-size:16px; color:#464646; font-weight:bold; background:#f7f7f7; padding:0 0 20px 10px; position:relative;}
ul.navMenu li a, ul.navMenu li a:visited{ color:#686868; text-decoration:none;}
ul.navMenu li a:hover, ul.navMenu li a.active, ul.navMenu li a.active:visited{ color:#ee8e02; text-decoration:none;}
/*ul.navMenu li.active a, ul.navMenu li.active a:visited{ color:#ee8e02; text-decoration:none;}*/
ul.navMenu li ul{ margin:0; padding:5px 0 0 15px; list-style:none; display:none;}
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;}
ul.navMenu li ul li a{ color:#7d7d7d; text-decoration:none; padding:6px 0 6px 0; display:block;}
ul.navMenu li ul li a:hover, ul.navMenu li ul li a.sel { color:#ee8e02; text-decoration:none;}
ul.navMenu li ul li ul{ margin:0; padding:0px 0 0 10px; list-style:none; display:none;}
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;}
ul.navMenu li ul li ul li a{color:#7d7d7d; text-decoration:none; padding:2px 0 2px 0; display:block;}
ul.navMenu li ul li ul li a:hover, ul.navMenu li ul li ul li a.sel { color:#ee8e02; text-decoration:none;}
Further post that would you like to learn in Salesforce
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
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 |