Try
$(document).ready(function () {
var $contents = $(".content").hide();
$(".heading").click(function () {
var $next = $(this).next(".content").stop(true, true).slideToggle(500);
$contents.not($next).hide();
});
$(".expand").click(function () {
$contents.stop(true, true).slideDown()
})
$(".contract").click(function () {
$contents.stop(true, true).slideUp()
});
})
Demo: Fiddle