<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>

		<title>Close Accordion Button? &#8211; Themeco Community</title>
		<atom:link href="https://theme.co/archive/forums/topic/close-accordion-button/feed/" rel="self" type="application/rss+xml" />
		<link>https://theme.co/archive/forums/topic/close-accordion-button/feed/</link>
		<description></description>
		<lastBuildDate>Sat, 11 Oct 2025 07:12:50 +0000</lastBuildDate>
		<generator>https://bbpress.org/?v=2.6.14</generator>
		<language>en-US</language>

		
														
					
				<item>
					<guid>https://theme.co/archive/forums/topic/close-accordion-button/#post-97047</guid>
					<title><![CDATA[Close Accordion Button?]]></title>
					<link>https://theme.co/archive/forums/topic/close-accordion-button/#post-97047</link>
					<pubDate>Tue, 02 Sep 2014 18:03:10 +0000</pubDate>
					<dc:creator>JCastelize</dc:creator>

					<description>
						<![CDATA[
						<p>Is there a way to place a button inside the accordion that closes it when you&#8217;re done reading? I have a lot of text in my accordions so by the time you&#8217;re done reading it, you have to scroll a ways up to close it again. </p>
<p>All X-theme shortcodes and wordpress are up to date. Here&#8217;s the page to which the question relates: <a href="http://www.wpgelsite.info/TriCore/testimonials/" rel="nofollow">http://www.wpgelsite.info/TriCore/testimonials/</a></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/close-accordion-button/#post-97154</guid>
					<title><![CDATA[Reply To: Close Accordion Button?]]></title>
					<link>https://theme.co/archive/forums/topic/close-accordion-button/#post-97154</link>
					<pubDate>Tue, 02 Sep 2014 20:19:20 +0000</pubDate>
					<dc:creator>Zeshan</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Jacqueline!</p>
<p>Thank you for writing in!</p>
<p>To achieve this, add the following jQuery code under <strong>Custom &gt; JavaScript</strong> in the Customizer:</p>
<pre><code>jQuery(document).ready(function($) {
   var close = $(&#039;.accordion-close&#039;),
       accBody = close.closest(&#039;.accordion-body&#039;),
       accHead = accBody.siblings(&#039;.x-accordion-heading&#039;).find(&#039;.x-accordion-toggle&#039;);
   
   close.click(function(e) {
      e.preventDefault();
      accBody.removeClass(&#039;in&#039;).animate({&#039;height&#039;: &#039;0px&#039;}, 300);
      accHead.addClass(&#039;collapsed&#039;);
   });

});
</code></pre>
<p>And add a link with class <strong>accordion-close</strong> at the end of you accordion body, like:</p>
<pre><code>&lt;a href=&quot;#&quot; class=&quot;accordion-close&quot;&gt;Close&lt;/a&gt;
</code></pre>
<p>Hope this helps. 🙂</p>
<p>Thank you.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/close-accordion-button/#post-97925</guid>
					<title><![CDATA[Reply To: Close Accordion Button?]]></title>
					<link>https://theme.co/archive/forums/topic/close-accordion-button/#post-97925</link>
					<pubDate>Wed, 03 Sep 2014 21:59:27 +0000</pubDate>
					<dc:creator>JCastelize</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks! That did the trick.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/close-accordion-button/#post-97932</guid>
					<title><![CDATA[Reply To: Close Accordion Button?]]></title>
					<link>https://theme.co/archive/forums/topic/close-accordion-button/#post-97932</link>
					<pubDate>Wed, 03 Sep 2014 22:04:32 +0000</pubDate>
					<dc:creator>Kosher K</dc:creator>

					<description>
						<![CDATA[
						<p>Good to hear that.</p>
<p>Cheers</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/close-accordion-button/#post-236698</guid>
					<title><![CDATA[Reply To: Close Accordion Button?]]></title>
					<link>https://theme.co/archive/forums/topic/close-accordion-button/#post-236698</link>
					<pubDate>Fri, 27 Mar 2015 21:31:31 +0000</pubDate>
					<dc:creator>Misho</dc:creator>

					<description>
						<![CDATA[
						<p>Hi!</p>
<p>I have just used this trick, works great!</p>
<p>I have added one more functionality:</p>
<p>If you close the long accordion with a button or link like this, you will end up at the place where the accordion ended, and you may have some content above which you have missed, so you need to scroll up. The user may  not even realize that he has just missed some content and continue to read from the place he ended up.</p>
<p>To solve this, simply add an ID to the accordion, like <code>my-accordion</code>.</p>
<p>Then modify the above link into: <code>&lt;a class=&quot;accordion-close&quot; href=&quot;#my-accordion&quot;&gt;Close&lt;/a&gt;</code></p>
<p>This will make the page scroll back to where you have started, so you can continue down the page after finishing with the accordion.</p>
<p>I hope this will be helpful. 🙂</p>
<p>Take care!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/close-accordion-button/#post-236848</guid>
					<title><![CDATA[Reply To: Close Accordion Button?]]></title>
					<link>https://theme.co/archive/forums/topic/close-accordion-button/#post-236848</link>
					<pubDate>Sat, 28 Mar 2015 02:04:03 +0000</pubDate>
					<dc:creator>Rue Nel</dc:creator>

					<description>
						<![CDATA[
						<p>Hello Misho,</p>
<p>Thanks for sharing what have you done in your site. For sure other X theme users will find this very handy.</p>
<p>Cheers,<br />
X</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/close-accordion-button/#post-237089</guid>
					<title><![CDATA[Reply To: Close Accordion Button?]]></title>
					<link>https://theme.co/archive/forums/topic/close-accordion-button/#post-237089</link>
					<pubDate>Sat, 28 Mar 2015 14:47:23 +0000</pubDate>
					<dc:creator>Misho</dc:creator>

					<description>
						<![CDATA[
						<p>No problem! 🙂</p>
<p>Unfortunately, i have found a downside on the second method: it will not work on touch screens. When pressed on a touch screen, it will not close the accordion, it will only make scroll to it.</p>
<p>When clicked with the mouse, both actions are executed, but when touched &#8211; only one works.</p>
<p>If there is no fix for this, the workaround is to make it visible for desktop only.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/close-accordion-button/#post-237101</guid>
					<title><![CDATA[Reply To: Close Accordion Button?]]></title>
					<link>https://theme.co/archive/forums/topic/close-accordion-button/#post-237101</link>
					<pubDate>Sat, 28 Mar 2015 15:54:04 +0000</pubDate>
					<dc:creator>Thai</dc:creator>

					<description>
						<![CDATA[
						<p>Hi <a href="https://theme.co/archive/users/misho/" class="bbp-user-mention bbp-user-id-21971"> @Misho</a>,<br />
Please try this following code instead of the previous code:</p>
<pre><code>
jQuery(document).ready(function($) {
	var close = $(&#039;.accordion-close&#039;),
	accBody = close.closest(&#039;.accordion-body&#039;),
	accHead = accBody.siblings(&#039;.x-accordion-heading&#039;).find(&#039;.x-accordion-toggle&#039;);

	close.on(&#039;click touchend&#039;,function(e) {
		e.preventDefault();
		accBody.removeClass(&#039;in&#039;).animate({&#039;height&#039;: &#039;0px&#039;}, 300);
		accHead.addClass(&#039;collapsed&#039;);
	});
});
</code></pre>
<p>Hope it helps.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/close-accordion-button/#post-237914</guid>
					<title><![CDATA[Reply To: Close Accordion Button?]]></title>
					<link>https://theme.co/archive/forums/topic/close-accordion-button/#post-237914</link>
					<pubDate>Mon, 30 Mar 2015 09:26:35 +0000</pubDate>
					<dc:creator>Misho</dc:creator>

					<description>
						<![CDATA[
						<p>Works on all devices now!</p>
<p>X support = wizards of code. 🙂</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/close-accordion-button/#post-237917</guid>
					<title><![CDATA[Reply To: Close Accordion Button?]]></title>
					<link>https://theme.co/archive/forums/topic/close-accordion-button/#post-237917</link>
					<pubDate>Mon, 30 Mar 2015 09:29:40 +0000</pubDate>
					<dc:creator>Paul R</dc:creator>

					<description>
						<![CDATA[
						<p>Thank you for your kind words. 🙂</p>
<p>Let us know if you have any further questions.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

