[jQuery] Question on a simple Accord Script
experienceascension.com/index.php/faq is the URL for the below code.
Below is the code snippet. I simple want to hide the 'next' answer,
but it hides all of them. Not sure why.. Any help? Thanks!
<script type="text/javascript" src="http://ccooanswering.com/js/
jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("a.forans").click(hideitems);
function hideitems() {
$(".answer").hide("slow");
}
$("a.takeans").click(showitems);
function showitems() {
$(".answer").show("slow");
}
});
</script>
<title><?php echo $title; ?></title>
<link rel="stylesheet" href="http://experienceascension.com/index.php/
stylesheets/main" type="text/css"/>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<div id="wrapperMain">
<div id="wrapperHead">
<div id="logo"><a href="http://experienceascension.com"><img
border="0" alt="Communication Centers of Ohio" src="http://
experienceascension.com/images/uploads/logo.gif" /></a></div>
<div id="mainNav"><a href="http://experienceascension.com">Home</a> |
<a href="http://experienceascension.com/index.php/about">About</a> |
<a href="http://experienceascension.com/index.php/prices">Prices</a> |
<a href="http://experienceascension.com/index.php/faq">FAQ</a> | <a
href="http://experienceascension.com/index.php/contact">Contact</a></
div>
<div id="mainLogin">
<input type="submit" name="" title="" class="graybutton" value="" />
<div class="floatright"><h2>Password:</h2> <input type="password"
name="password" class="smallinput" /></div>
<div class="floatright"><h2>Username:</h2> <input type="text"
name="username" class="smallinput" /></div>
</div>
</div> <!-- end wrapperHead -->
<div id="wrapperBody">
<h1>FAQ</h1>
<div id="faqbody">
<h1>Frequently Asked Questions</h1>
{exp:weblog:entries weblog="faq"}
<div class="faqtag">
<b>{question}</b><a href="#" class="takeans"> Show Answer</a> | <a
href="#" class="forans">Hide Answer</a><br /><div
class="answer">{answer}</div>
</div>
{/exp:weblog:entries}
</div>