Jquery expand from external link
<p>I am trying to make it so that when a user clicks on a link from one page, it goes to another page that has a simple jquery collapsed text and expands (un-collapses) the text. My attempt is with the code below:</p>

<pre><code>$(function() {
  var elem = $('#expand-4' + location.hash); 
  $('#expand-4-text').slideToggle('fast', function() {
     // Animation complete.
  });
  $('#expand-4').toggleClass('expand-4-expanded');
});
</code></pre>

<p>It does not work though.  Can someone tell me why?</p>
