Today, We want to share with you jQuery Accordion Vertical Menu using CSS.In this post we will show you Vertical accordion menu using jQuery and CSS3, hear for How To Code a Vertical Accordion Nav Menu with jQuery we will give you demo and example for implement.In this post, we will learn about How to create Accordion Vertical Menu using JQuery and CSS? with an example.
jQuery Accordion Vertical Menu using CSS
There are the Following The simple About A Simple Accordion Menu using jQuery and CSS Full Information With Example and source code.
As I will cover this Post with live Working example to develop accordion jquery examples with source code, so the jquery accordion menu vertical 3 level is used for this example is following below.
HTML Part
index.html
I will create HTML file.Just see bellow HTML with jQuery and css example html file and run in your local too.
Step 2: jQuery/JavaScript Part
we will simply include jquery CDN file. as well as We added some custom jQuery or pure JavaScript Source code.
using jquery CDN
jQuery Source code
$(document).ready(function() { $('.accordion li').click(function(ev) { if (!$(ev.target).is('a')) { if (!$(this).find('> ul').is(':visible')) { $(this).find('> ul').show(); $(this).find('> span.indicatordown').addClass('indicatorup'); $(this).find('> span.indicatordown').removeClass('indicatordown'); } else { $(this).find('> ul').hide(); $(this).find('> span.indicatorup').addClass('indicatordown'); $(this).find('> span.indicatorup').removeClass('indicatorup'); } return false; } }); });
CSS part
.primarycatslist{ width:250px; } .primarycatslist ul , .primarycatslist ul li{ margin:0; padding:0; list-style:none; } .primarycatslist ul li{ background: #afd0e7; border-bottom: 2px solid #f1f8fd; position: relative; cursor:pointer; } .primarycatslist ul li a { text-decoration: none; color: #333; padding: 7px 7px; display:inline-block; } .primarycatslist ul li ul li.lisubfirst{ border-top: 2px solid #f1f8fd; } .primarycatslist ul li ul li.lisublast{ border-bottom:none; } .primarycatslist ul li ul li{ background:#c2dbed; } .primarycatslist ul li ul li a{ padding: 11px 21px; } .primarycatslist ul li ul li ul li{ background:#d7e9f6; } .primarycatslist ul li ul li ul li a{ padding: 11px 40px; } .coronaspan{ background:url(rss.png) no-repeat; width:16px; height:16px; position:absolute; right:11px; top:11px; display:inline-block; } .coronaspan a{ width:16px; height:16px; display:inline-block; overflow:hidden; cursor:pointer; } .indicatorup, .indicatordown{ width:16px; height:16px; position:absolute; right:32px; top:12px; cursor:pointer; background:url(arrow_top.png) no-repeat; display:inline-block; overflow:hidden; } .indicatordown{ background:url(arrow_bottom.png) no-repeat; }
Web Programming Tutorials Example with Demo
Read :
Summary
You can also read about AngularJS, ASP.NET, VueJs, PHP.
I hope you get an idea about jquery vertical accordion menu.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.