title: Undesired page scroll when changing content of fixed element
body: <p>So I've made a menu sort of thing, affixed to the bottom of the screen via CSS fixed position, and it works fine. Only problem is that when the page is scrolled down somewhat, and then the menu activated (slide up animated with jQuery), the page jumps to the top again. It's pretty irritating. Here's some pertinent code:</p>
  
  <pre><code>//handle click on stats tab
  $('a.stats').click(function(e) {
      if ($('#menuWrapper').hasClass("stats")) {
          $('#menuWrapper').removeClass("stats")
          .removeClass("open")
          .animate({ bottom: '-100px'}, 300);
      } else if (!$('#menuWrapper').hasClass("open")) {
          $('#sponsors').hide();
          $('#feedback').hide();
          $('#stats').show();
          $('#menuWrapper').animate({ bottom: '0px'}, 300)
          .addClass("stats")
          .addClass("open");
      } else {
          $('#menuWrapper').addClass("stats");
          $('#sponsors').fadeOut();
          $('#feedback').fadeOut();
          $('#stats').fadeIn();
      }
      $('#menuWrapper').removeClass("sponsors")
      .removeClass("feedback");
  });
  </code></pre>
  
  <p>(this is an example of how I change the content. I have similar functions which change the content or minimize the menu depending on its current state.)</p>
  
  <pre><code>&lt;div id="menuWrapper"&gt;
  
      &lt;div id="menuTop"&gt;
          &lt;a href="#" class="sponsors"&gt;Sponsors&lt;/a&gt; | &lt;a href="#" class="feedback"&gt;Feedback&lt;/a&gt; | &lt;a href="#" class="stats"&gt;Stats&lt;/a&gt;
      &lt;/div&gt;
  
      &lt;div id="menuContent"&gt;
          &lt;div id="sponsors"&gt;&lt;/div&gt;
          &lt;div id="feedback"&gt;&lt;/div&gt;
          &lt;div id="stats"&gt;&lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>(and this is what the HTML looks like, before the content is dynamically loaded into the sponsors, feedback, and stats divs.)</p>
  
  <p>To see an example of the funky functionality if necessary, see <a href="http://www.crowdsplat.com/alpha" rel="nofollow noreferrer">http://www.crowdsplat.com/alpha</a>. If you have any insight into what may be causing this and/or how I can fix it, I'd greatly appreciate it. Thanks for your time.</p>