




















<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Creating an Accordion with HTML, CSS &#038; jQuery	</title>
	<atom:link href="https://www.inspirationalpixels.com/accordion-html-css-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/</link>
	<description>Web design tutorials, snippets and freebies</description>
	<lastBuildDate>Tue, 13 Jul 2021 16:41:23 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>
		By: awesome		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-5421</link>

		<dc:creator><![CDATA[awesome]]></dc:creator>
		<pubDate>Tue, 09 Apr 2019 19:25:55 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-5421</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-632&quot;&gt;Seb Kay&lt;/a&gt;.

thanks so much for this, worked perfectly!!!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-632">Seb Kay</a>.</p>
<p>thanks so much for this, worked perfectly!!!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Awesome		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-5420</link>

		<dc:creator><![CDATA[Awesome]]></dc:creator>
		<pubDate>Tue, 09 Apr 2019 19:04:19 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-5420</guid>

					<description><![CDATA[Really great! The best script / solution out there! Thanks so much Seb!]]></description>
			<content:encoded><![CDATA[<p>Really great! The best script / solution out there! Thanks so much Seb!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Florin		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-2684</link>

		<dc:creator><![CDATA[Florin]]></dc:creator>
		<pubDate>Tue, 18 Sep 2018 20:39:36 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-2684</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-764&quot;&gt;Alex&lt;/a&gt;.

THANK YOU FOR THIS!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-764">Alex</a>.</p>
<p>THANK YOU FOR THIS!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Harish Patil		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-774</link>

		<dc:creator><![CDATA[Harish Patil]]></dc:creator>
		<pubDate>Fri, 23 Mar 2018 07:25:47 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-774</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-750&quot;&gt;Julie&lt;/a&gt;.

Hi i am harish patil i am a php student   You&#039;ll be my fan                                patilharish002@gmail.com]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-750">Julie</a>.</p>
<p>Hi i am harish patil i am a php student   You&#8217;ll be my fan                                <a href="mailto:patilharish002@gmail.com">patilharish002@gmail.com</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Robert		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-773</link>

		<dc:creator><![CDATA[Robert]]></dc:creator>
		<pubDate>Thu, 25 Jan 2018 06:11:22 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-773</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-768&quot;&gt;jos&lt;/a&gt;.

your code worked!!!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-768">jos</a>.</p>
<p>your code worked!!!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Subhrahtoti		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-772</link>

		<dc:creator><![CDATA[Subhrahtoti]]></dc:creator>
		<pubDate>Fri, 15 Dec 2017 16:00:45 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-772</guid>

					<description><![CDATA[I have one Panel having two child panel which is showing  by  default.
My requirement is to show only one  different panel under main panel if java variable showTwopanel =true else show  only one panel.]]></description>
			<content:encoded><![CDATA[<p>I have one Panel having two child panel which is showing  by  default.<br />
My requirement is to show only one  different panel under main panel if java variable showTwopanel =true else show  only one panel.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kate		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-771</link>

		<dc:creator><![CDATA[Kate]]></dc:creator>
		<pubDate>Tue, 17 Oct 2017 10:43:16 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-771</guid>

					<description><![CDATA[[js]
$(document).ready(function() {
	$(&#039;.accordion .accordion-section:first-child .accordion-section-title&#039;).addClass(&#039;first&#039;);
    function close_accordion_section() {
		$(&#039;.accordion .accordion-section:first-child .accordion-section-title&#039;).removeClass(&#039;first&#039;);
        $(&#039;.accordion .accordion-section-title&#039;).removeClass(&#039;active&#039;);
        $(&#039;.accordion .accordion-section-content&#039;).slideUp(300).removeClass(&#039;open&#039;);
    }
 
    $(&#039;.accordion-section-title&#039;).click(function(e) {
        // Grab current anchor value
        var currentAttrValue = $(this).attr(&#039;href&#039;);
 
        if($(e.target).is(&#039;.active&#039;)) {
            close_accordion_section();
        }else {
            close_accordion_section();
 
            // Add active class to section title
            $(this).addClass(&#039;active&#039;);
			$(this).removeClass(&#039;first&#039;);
            // Open up the hidden content panel
            $(&#039;.accordion &#039; + currentAttrValue).slideDown(300).addClass(&#039;open&#039;); 
        }
 
        e.preventDefault();
    });
[/js]]]></description>
			<content:encoded><![CDATA[<p>[js]<br />
$(document).ready(function() {<br />
	$(&#8216;.accordion .accordion-section:first-child .accordion-section-title&#8217;).addClass(&#8216;first&#8217;);<br />
    function close_accordion_section() {<br />
		$(&#8216;.accordion .accordion-section:first-child .accordion-section-title&#8217;).removeClass(&#8216;first&#8217;);<br />
        $(&#8216;.accordion .accordion-section-title&#8217;).removeClass(&#8216;active&#8217;);<br />
        $(&#8216;.accordion .accordion-section-content&#8217;).slideUp(300).removeClass(&#8216;open&#8217;);<br />
    }</p>
<p>    $(&#8216;.accordion-section-title&#8217;).click(function(e) {<br />
        // Grab current anchor value<br />
        var currentAttrValue = $(this).attr(&#8216;href&#8217;);</p>
<p>        if($(e.target).is(&#8216;.active&#8217;)) {<br />
            close_accordion_section();<br />
        }else {<br />
            close_accordion_section();</p>
<p>            // Add active class to section title<br />
            $(this).addClass(&#8216;active&#8217;);<br />
			$(this).removeClass(&#8216;first&#8217;);<br />
            // Open up the hidden content panel<br />
            $(&#8216;.accordion &#8216; + currentAttrValue).slideDown(300).addClass(&#8216;open&#8217;);<br />
        }</p>
<p>        e.preventDefault();<br />
    });<br />
[/js]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Michael		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-770</link>

		<dc:creator><![CDATA[Michael]]></dc:creator>
		<pubDate>Mon, 16 Oct 2017 05:31:17 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-770</guid>

					<description><![CDATA[I may be missing something but the class &quot;open&quot; doesn&#039;t appear in either the markup and is not defined in the CSS.  Could someone please explain how that works.  Thanks.]]></description>
			<content:encoded><![CDATA[<p>I may be missing something but the class &#8220;open&#8221; doesn&#8217;t appear in either the markup and is not defined in the CSS.  Could someone please explain how that works.  Thanks.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Brandon		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-769</link>

		<dc:creator><![CDATA[Brandon]]></dc:creator>
		<pubDate>Thu, 28 Sep 2017 12:32:36 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-769</guid>

					<description><![CDATA[For those wondering (like me!) how to get one accordion section to be open on initial page load, take Alex&#039;s improved JS and add a couple lines to the end:

[html]
function close_accordion_section() {
    $(&#039;.accordion .accordion-section-title&#039;).removeClass(&#039;active&#039;);
    $(&#039;.accordion .accordion-section-content&#039;).slideUp(300).removeClass(&#039;open&#039;);
}
 
$(&#039;.accordion-section-title&#039;).on(&#039;click&#039;, function(e){
        e.preventDefault();
        var currentAttrValue = $(this).next();
 
        if($(this).is(&#039;.active&#039;)) {
            close_accordion_section();
        }
        else {
            close_accordion_section();
            $(this).addClass(&#039;active&#039;);
            $(currentAttrValue).slideDown(300).addClass(&#039;open&#039;);
        }
});

// Activate first accordion item on page load. Change CSS selector as needed to work with your own HTML structure.
$(&#039;.accordion:first-child .accordion-section-title&#039;).addClass(&#039;active&#039;);
$(&#039;.accordion:first-child .accordion-section-content&#039;).slideDown(0).addClass(&#039;open&#039;);
[/html]]]></description>
			<content:encoded><![CDATA[<p>For those wondering (like me!) how to get one accordion section to be open on initial page load, take Alex&#8217;s improved JS and add a couple lines to the end:</p>
<p>[html]<br />
function close_accordion_section() {<br />
    $(&#8216;.accordion .accordion-section-title&#8217;).removeClass(&#8216;active&#8217;);<br />
    $(&#8216;.accordion .accordion-section-content&#8217;).slideUp(300).removeClass(&#8216;open&#8217;);<br />
}</p>
<p>$(&#8216;.accordion-section-title&#8217;).on(&#8216;click&#8217;, function(e){<br />
        e.preventDefault();<br />
        var currentAttrValue = $(this).next();</p>
<p>        if($(this).is(&#8216;.active&#8217;)) {<br />
            close_accordion_section();<br />
        }<br />
        else {<br />
            close_accordion_section();<br />
            $(this).addClass(&#8216;active&#8217;);<br />
            $(currentAttrValue).slideDown(300).addClass(&#8216;open&#8217;);<br />
        }<br />
});</p>
<p>// Activate first accordion item on page load. Change CSS selector as needed to work with your own HTML structure.<br />
$(&#8216;.accordion:first-child .accordion-section-title&#8217;).addClass(&#8216;active&#8217;);<br />
$(&#8216;.accordion:first-child .accordion-section-content&#8217;).slideDown(0).addClass(&#8216;open&#8217;);<br />
[/html]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jos		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-768</link>

		<dc:creator><![CDATA[jos]]></dc:creator>
		<pubDate>Tue, 26 Sep 2017 18:04:24 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-768</guid>

					<description><![CDATA[Opens the first!
$( document ).ready(function() {
             $(&#039;a[href$=&quot;#accordion-1&quot;]&#039;).click();

});]]></description>
			<content:encoded><![CDATA[<p>Opens the first!<br />
$( document ).ready(function() {<br />
             $(&#8216;a[href$=&#8221;#accordion-1&#8243;]&#8217;).click();</p>
<p>});</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: anmol		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-767</link>

		<dc:creator><![CDATA[anmol]]></dc:creator>
		<pubDate>Sat, 22 Jul 2017 10:23:19 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-767</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-763&quot;&gt;Rajesh&lt;/a&gt;.

Sir Please tell me how i could 1st accordian be opende by default when page is refreshed]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-763">Rajesh</a>.</p>
<p>Sir Please tell me how i could 1st accordian be opende by default when page is refreshed</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Nilam		</title>
		<link>https://www.inspirationalpixels.com/accordion-html-css-jquery/#comment-766</link>

		<dc:creator><![CDATA[Nilam]]></dc:creator>
		<pubDate>Thu, 11 May 2017 13:00:14 +0000</pubDate>
		<guid isPermaLink="false">http://staging.inspirationalpixels.com/?p=936#comment-766</guid>

					<description><![CDATA[Hello
I want show default open one accordion when page is load .How I can do this.
please as soon as possible.
Thank you.]]></description>
			<content:encoded><![CDATA[<p>Hello<br />
I want show default open one accordion when page is load .How I can do this.<br />
please as soon as possible.<br />
Thank you.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
