Jump to content

jQuery toggle not working in FF?


lastlifelost

Recommended Posts

I'm working with a content toggle to reveal the comments section of a blog post. It works everywhere except FF. I can't see the error, I don't even know where to start tracing it from. My guess is that the anchor link is trying to refresh the page. Can anyone else see what's going on? The pertinent code is below, as well as a link to the live blog.

	<script type="text/javascript">			function toggleElement(id) {				$(id).toggle('slow');				return false;			}	</script>

	<a href="#comments"  class="clear-floats italic" onclick="toggleElement(commentsFor53)">See who's talking & Leave Nina a comment!</a>	<section id="commentsFor53" style="display:none"> <!-- this article's comments -->			...	</section>

live site: Proud Flower Blog

Link to comment
Share on other sites

It seems to work for FF4. I see a 404 error when the site is trying to load AC_RunActiveContent.js

Link to comment
Share on other sites

Fixed the 404, thanks for pointing that out. This still isn't working for me. I'm running FF4.0.1. When I go to the blog page and click the "See who's talking & Leave Nina a comment!" link under any of the blog posts, nothing happens. You're not having any issues here? I cannot for the life of me figure out why this isn't working. I even checked to make sure that I have Javascript turned on, just in case! What am I missing here?What should be happening is when the "See who's..." link is clicked all of the comments and the comment form should slide into view underneath the blog post. This works in IE, O, Ch, and S. Only FF is giving me trouble. Is there something wrong with my FF install or is the a reproducable issue?

Link to comment
Share on other sites

Here's where the error is:

function onclick(event) {toggleElement(commentsFor53);}

And here's the error text:

commentsFor53 is not defined.

Tested with Firebug for Firefox.

Link to comment
Share on other sites

In that case you will have to useonclick="toggleElement('commentsFor53')"withfunction toggleElement(id) { $("#"+id).toggle('slow'); return false; }ORonclick="toggleElement('#commentsFor53')"withfunction toggleElement(id) { $(id).toggle('slow'); return false; }

Link to comment
Share on other sites

Here's where the error is:
function onclick(event) {toggleElement(commentsFor53);}

And here's the error text:

commentsFor53 is not defined.

Tested with Firebug for Firefox.

In that case you will have to useonclick="toggleElement('commentsFor53')"withfunction toggleElement(id) { $("#"+id).toggle('slow'); return false; }ORonclick="toggleElement('#commentsFor53')"withfunction toggleElement(id) { $(id).toggle('slow'); return false; }
That did it! I knew it had to be something easy I was missing. Thanks to you all for looking my code over!
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...