title: Javascript/jQuery slowdown when switching to full screen
body: <p>I have some strange behavior from firefox, I'm building a single page portfolio and as a graphic designer the coding has been hard. I wanted to smoothly control the navigation and then later added scaling to all the elements (designed for 1920x1080 full screen initially). The lecturer dropped a bomb that it needed to scroll vertically as well, I am in the process of trying to get the vertical navigation to work.</p>
  
  <p>The issue is when I switch to full screen most of the navigation code seems to take a long pause before it executes. This only happens when I switch to full screen. If I switch and refresh then it's ok. I really want to know whats slowing the whole thing down.</p>
  
  <p>I have tried safe mode with no plugins. I'm using Firefox 24.0 with Firebug to get at the bits an pieces.</p>
  
  <p>I have created a code fiddle (my first and it's already broken):
  <a href="http://jsfiddle.net/jeffreyknipe/xfjmC/1/" rel="nofollow">http://jsfiddle.net/jeffreyknipe/xfjmC/1/</a></p>
  
  <p>The code for the scrolling is as follows:</p>
  
  <pre><code>    function navTo(horizontal, vertical) {
          browserWidth = $(window).innerWidth();
          browserHeight = $(window).innerHeight();
          newRatio = browserWidth / 1920;
  
          $('html body div#full_site section#pages_section').animate({
              marginLeft: '-' + browserWidth * horizontal,
              marginTop: (browserWidth / 16 * 9) * vertical
          }, 1000);
          if (horizontal == 0) {
              $('#menuspace #floating_topbar #menuzone').animate({
                  marginRight: 0
              });
          } else {
              $('#menuspace #floating_topbar #menuzone').animate({
                  marginRight: (newRatio * (-340))
              });
          };
      };
  </code></pre>
  
  <p>I know the coders out there will frown on how inefficient the code is but any advice will be appreciated. The biggest thing is the full screen code slow down.</p>
  
  <p>Thanks.</p>