/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$("#expandable_content a.trigger").click(function() { var selection=$(this).next("div.section") if ($(selection).hasClass("expanded")) { $(this).next("div.section") .slideUp(700) .addClass("collapsed") .removeClass("expanded") } else { $(this).next("div.section") .slideDown(700) .addClass("expanded") .removeClass("collapsed") } })