 <p>Is this the basic idea of what you're looking for:</p> <p><a href="http://jsfiddle.net/cgsfb/1/" rel="nofollow">http://jsfiddle.net/cgsfb/1/</a></p> <pre><code>$(document).ready(function(){ var toggler = $('div[id*="toggle-image"]'); toggler.attr("class", "toggle-image-expand"); //Hide (Collapse) the toggle containers on load $("div[class*='toggle-container']").hide(); $("h3[class*='trigger']").click(function(){ var toggler_inner = $(this).find(toggler); $(this).toggleClass("active").next().slideToggle("slow"); if (toggler_inner.attr("class") == "toggle-image-collapse") { toggler_inner.attr("class", "toggle-image-expand"); } else { toggler_inner.attr("class", "toggle-image-collapse"); } return false; }); }); </code></pre>