Baffling Rails 3.2.6 Jquery Error for Accordion Effect on Localhost
===

So I have the following .js code for a jquery effect in my rails app (however instead of "p" element I have "table":)

    $(document).ready(function(){

	$(".accordion h3:first").addClass("active");
	$(".accordion p:not(:first)").hide();


	$(".accordion h3").click(function(){
	
	  $(this).next("p").slideToggle("slow")
	  .siblings("p:visible").slideUp("slow");
	  $(this).toggleClass("active");
	  $(this).siblings("h3").removeClass("active");
	
	});

});

It works fine when I push my app up to heroku.  

1) But on my localhost machine, when I click on the first "h3" element it doesn't do anything.  When I click on a sibling h3, the first "h3" slides up.  And then I click on the other "h3" elements and they stay open for a second or two before sliding up.  It's important the "h3" elements stay open since they are hiding the data fields a user can edit in the rails app.
2)  When I take the above .js code and run it in the Web Developer toolbar console for scripting, then it works fine.  

It does the same thing in Google Chrome too.  Any insights?  I've spent a few hours on this, and am not getting anywhere.