views:

106

answers:

1

Hey guys,

I am wondering if there is a way to add a close button (or action) to this accordion script I'm working on. I have no jquery knowledge, but am eager to learn it.

Here is my accordion code:

$(document).ready(function(){

$(".accordion .intro:first").addClass("active");
$(".accordion .more:not(:first)").hide();

$(".accordion .intro").click(function(){

  $(this).next(".more").slideToggle("slow")
  .siblings(".more:visible").slideUp("slow");
  $(this).toggleClass("active");
  $(this).siblings(".intro").removeClass("active");

});

});

I would like to add a class to close, so I can add a button in the content to close or .slideUp

Thanks.