Jump to content
lastlifelost

jQuery toggle not working in FF?

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

Edited by lastlifelost

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
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; }

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...