title: jQuery to trigger event through query string
body: <p>I have two separate jQuery functions that allow a user to toggle a div's visibility. By defualt, the divs will be in their closed state.  I'm trying to figure out a way to set up links to this page that will open a specific div based on an ID passed to the query string. My jQuery looks like this:</p>
  
  <pre><code>    jQuery(document).ready(function(){
  
     //make first div always open
  
      jQuery(".toggle_container:not(:first)").hide(); 
      jQuery(".toggle_container:first").show();
      jQuery("h6.trigger:first").addClass("active");
  
      jQuery("h6.trigger").click(function(){
        jQuery(this).toggleClass("active");
        jQuery(this).next(".toggle_container").slideToggle(300);
      });
  
      //The second function
  
      jQuery(function(){
          jQuery(".toggleIt").click(function(){
            jQuery(this).next(".hiddenText").slideToggle("fast"); 
              jQuery(this).html(function(i,html) {
                  if (html.indexOf('+') != -1 ){
                     html = html.replace('+','-');
                  } else {
                     html = html.replace('-','+');
                  }
                  return html;
              })
          });
      }); 
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;h6 class="trigger" id='uniqueID"&gt;&lt;/h6&gt;
   &lt;div class="toggle_container"&gt;
  TEST
  &lt;/div&gt;
  
  //and the second toggled container
   &lt;p class="toggleThis tips" id="AnotherID"&gt;+&lt;/p&gt;
  &lt;div class="hiddenText2"&gt;
  Another TEST
  &lt;/div&gt;
  </code></pre>
  
  <p>I'd like to add an ID to the query string of a url and have it open the hidden div with the same ID.  I have it structured like this so far...</p>
  
  <pre><code>var category = getParameterByName('cat');
  var id = getParameterByName('id');
  
  if(id)
  {
  
  }
  else if(category)
  {
  
  }
  else
  {
      //moving this in here 
      jQuery(".toggle_container:not(:first)").hide(); 
      jQuery(".toggle_container:first").show();
      jQuery("h6.trigger:first").addClass("active");
  }
  </code></pre>
  
  <p>I'm getting stuck on this part.  Any tips? </p>