Quote:
Originally Posted by chuckroast The JavaScript in the <head> needs to be placed in between {literal} JavaScript {/literal} tags |
Tried this and it still doesnt work. All i get is the same result on the page but the literal tags show as text... and the three question links but not the title nor the drop down text (answers)...
http://www.spirr-it.com/page.php?page=faq-test PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Digg-style FAQ page</title>
{literal}
<script type="text/javascript" src="jquery.js"> </script>
<script type="text/javascript">
$(document).ready(function() {
$("a[name^='faq-']").each(function() {
$(this).click(function() {
if( $("#" + this.name).is(':hidden') ) {
$("#" + this.name).fadeIn('slow');
} else {
$("#" + this.name).fadeOut('slow');
}
return false;
});
});
});
</script>
{/literal}
<style type="text/css">
.faq-answer {
display:none;
}
</style>
</head>
<body>
<a href="#" name="faq-1">What is Digg like FAQ?</a><br />
<div class="faq-answer" id="faq-1">It's like this: http://www.digg.com/faq<br /><br /></div>
<a href="#" name="faq-2">Is it easy to make?</a><br />
<div class="faq-answer" id="faq-2">Yes it's very easy to make!<br /><br /></div>
<a href="#" name="faq-3">Why would I want to do that?</a><br />
<div class="faq-answer" id="faq-3">And your page will be so much cleaner.<br /><br /></div>
</body>
</html>
Perhaps jquery file was wrong? or placing this sode in the page creator has something to do with it?
thanks alot i appreciate it!