Simple Accordion in jQuery, Accordion in jQuery

I'm sharing simple jQuery Accordion which can be used anywhere in your project where you want to be accordian.

<html>
<head>
    <title>Menu Slide Accordian</title>
    <script type="text/javascript" src="
https://code.jquery.com/jquery-1.11.3.js"></script>
    <script>
        jQuery(document).ready(function(){    
            jQuery('.child-trigger').click(function() {
            jQuery(this).parent().siblings('.menu-item-has-children').find('.child-trigger').removeClass('activate');
            jQuery(this).parent().siblings('.menu-item-has-children').find('ul.sub-menu').slideUp(250);
            jQuery(this).next('ul.sub-menu').slideToggle(250);
            jQuery(this).next('ul.sub-menu').children('.menu-item-has-children').find('ul.sub-menu').slideUp(250);
            jQuery(this).next('ul.sub-menu').children('.menu-item-has-children').find('.child-trigger').removeClass('activate');
            jQuery(this).toggleClass('activate');
            return false;
            });    
        });    
    </script>
    
    <style>    
        ul,li{
            padding:0;
            margin:0;
        }    
        .menuSlide {
            background: #0aa899;
            height: 100%;
            max-width: 440px;
            width:100%;
            top: 0;
            position: fixed;
            overflow: scroll;
            overflow-x: hidden;
            overflow-y: auto;
            max-height: 100%;
            -webkit-transition: all .4s ease;
            -moz-transition: all .4s ease;
            transition: all .4s ease;
        }
        
        ul.sub-menu{
            display:none;
        }
    
        .menuSlide li {
            display: block;
            padding-right: 0;
            border-bottom: 1px solid rgba(255, 255, 255, .35);
            position: relative;
        }
        
        .menuSlide li a {
            font-size: 16px;
            padding: 20px 10px 20px 40px;
            line-height: 20px;
            display: block;
            color: #ffffff;
            text-transform: uppercase;
            text-decoration:none;
        }
    
        .menuSlide ul.sub-menu {
            background-color: rgba(10, 156, 142, 0.63);
        }
        
        .menuSlide .child-trigger {
            display: block;
            cursor: pointer;
            position: absolute;
            top: 0;
            right: 0;
            width: 55px;
            min-width: 55px;
            height: 60px;
            padding: 0;
            border-left: 1px solid rgba(255, 255, 255, .20);
        }
        
        .child-trigger i, 
        .child-trigger i:after {
            width: 10px;
            height: 1px;
            background-color: #fff;
            display: block;
        }
        
        .child-trigger i {
            position: relative;
            top: 50%;
            margin: 0 auto;
        }
        
        .child-trigger i:after {
            position: absolute;
            content: '';
        }
        
        .child-trigger i:after {
            -webkit-transform: rotate(-90deg);
            -ms-transform: rotate(-90deg);
            transform: rotate(-90deg);
        }
        
        .child-trigger.activate i:after {
            -webkit-transform: rotate(-180deg);
            -ms-transform: rotate(-180deg);
            transform: rotate(-180deg);
    }    
    </style>
    
</head>

<body>
    <div class="menuSlide">
        <ul>
            <li class="menu-item"><a href="">Home</a></li>
            <li class="menu-item"><a href="">Portfolio</a></li>
            <li class="menu-item menu-item-has-children"><a href="#">Slide1</a>
                <div class="child-trigger"><i></i></div>
                <ul class="sub-menu" style="">
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                </ul>
            </li>
            
            <li class="menu-item menu-item-has-children"><a href="#">Slide2</a>
                <div class="child-trigger"><i></i></div>
                <ul class="sub-menu" style="">
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                </ul>
            </li>
            
            <li class="menu-item menu-item-has-children"><a href="#">Slide2</a>
                <div class="child-trigger"><i></i></div>
                <ul class="sub-menu" style="">
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                    <li><a href="">Sub-slide</a></li>
                </ul>
            </li>
        </ul>
    </div>
</body>

</html>

0   0
Shailesh Kumar
profile kop 13th August 2025

Well I truly enjoyed reading it. This article offered by you is very useful for accurate planning. ëˆ„누티비

profile marina 17th July 2025

I’ve built several interfaces using a simple ReactJS training in kochi accordion in jQuery, and it’s an effective way to organize content without overwhelming users. I like how easy it is to implement with just a few lines of code. It keeps layouts clean, especially for FAQs or nested sections that need quick toggling.

profile kop 16th May 2025

Whats up! I just would like to give a huge thumbs up for the nice data you have here on this post. I will probably be coming back to your blog for extra soon. ë£¨í”¼ì¹´ì§€ë…¸

profile kop 16th May 2025

I’ll immediately grab your rss as I can’t find your e-mail subscription link or e-newsletter service. Do you’ve any? Please let me know in order that I could subscribe. Thanks. í…í…ë²³

profile kop 16th May 2025

Excellent post however I was wanting to know if you could write a litte more on this topic? I’d be very thankful if you could elaborate a little bit more. Thank you! ì§€ë‹ˆì¹´ì§€ë…¸

profile kop 16th May 2025

Thanks  for another informative website. The place else may I am getting that type of info written in such an ideal means? I’ve a undertaking that I’m just now operating on, and I have been on the glance out for such info. ë¼ë°”카지노

profile kop 16th May 2025

Of course, what a magnificent site and illuminating posts, I will bookmark your website.Have an awsome day! ì§±êµ¬ì¹´ì§€ë…¸

profile kop 9th May 2025

Hi there! I could have sworn I’ve been to this web site before butafter looking at a few of the posts I realized it’s new to me.Anyhow, I’m definitely pleased I found it and I’ll be book-marking it and checkingback often! 티비착

profile kop 9th May 2025

Hi there, after reading this remarkable pieceof writing i am also glad to share my knowledge here with friends. 여기여

profile kop 9th May 2025

Hey! This is my first comment here so I just wanted to give a quick shoutout and say I really enjoy reading your blog posts. Can you recommend any other blogs. 티비위키

profile kop 9th May 2025

It’s actually very complex in this full of activity life to listen news on Television, thus I simplyuse the web for that purpose, and take the most up-to-dateinformation. 주소모아

profile kop 9th May 2025

Excellent blog you’ve got here.. It?s digficult to find high qualitywriting like yours these days. I seriously appreciate individuals like you!Take care!! 링크사랑

profile kop 9th May 2025

Hey there,  You’ve done a fantastic job. I’ll definitely digg it and personally suggest to my friends.I’m confident they will be benefited from this site. íˆ°ì½”

profile kop 9th May 2025

I every time used to read piece of writing in news papers but now as I ama user of net thus from now I am using net for articlesor reviews, thanks to web. ë§ˆë‚˜í† ë¼

profile kop 8th May 2025

As soon as I found this internet site I went on reddit to share some of the love with them. ëˆ„누티비

Please rotate your device

We don't support landscape mode on your device. Please rotate to portrait mode for the best view of our site