<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MoonKat Creations &#187; script</title>
	<atom:link href="http://www.moonkatcreations.com/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.moonkatcreations.com</link>
	<description>Web design, front-end development</description>
	<lastBuildDate>Thu, 12 May 2011 18:52:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Show/hide function for questions and answers</title>
		<link>http://www.moonkatcreations.com/web-design/jquery/showhide-function-for-questions-and-answers/</link>
		<comments>http://www.moonkatcreations.com/web-design/jquery/showhide-function-for-questions-and-answers/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 22:15:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[accordion navigation]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[toggle]]></category>

		<guid isPermaLink="false">http://www.moonkatcreations.com/?p=57</guid>
		<description><![CDATA[Here&#8217;s a neat little script that allows a question and answer type format, where the questions are all listed as links, and clicking on one toggles the visibility of the corresponding answer. $("p").hide(); $("a").click(function () { $(this).next("p:first").slideToggle("fast"); }); Here&#8217;s a &#8230; <a href="http://www.moonkatcreations.com/web-design/jquery/showhide-function-for-questions-and-answers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a neat little script that allows a question and answer type format, where the questions are all listed as links, and clicking on one toggles the visibility of the corresponding answer.</p>
<pre>$("p").hide();
$("a").click(function () {
$(this).next("p:first").slideToggle("fast");
});</pre>
<p>Here&#8217;s a version for lists that can be used to build an accordion navigation menu:</p>
<pre>$("ul li ul").hide();
$("a").click(function () {
$(this).next("ul:first").slideToggle("fast");
});</pre>
<p>Thanks to this post on Stackoverflow for the inspiration:</p>
<p>http://stackoverflow.com/questions/248320/using-this-with-jquery-selectors/248335</p>
<p>My selectors allow you to have multiple questions listed on one page. The answers given to the question on Stackoverflow only allowed for one, since, if clicked, it would toggle ALL of the paragraphs simultaneously.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moonkatcreations.com/web-design/jquery/showhide-function-for-questions-and-answers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

