title: .click function is triggering on page load
body: <p>This code is only supposed to run when the Register button is clicked but instead it's adding it below the login page. Once Register is clicked though it goes to Register layout and when you click back on log in, it is the correct log in layout.
  How can I stop it from doing this?</p>
  
  <pre><code>$(function() {
      $('#login-form-link').click(function(e) {
          $("#login-form").delay(100).fadeIn(100);
          $("#register-form").fadeOut(100);
          $('#register-form-link').removeClass('active');
          $(this).addClass('active');
          e.preventDefault();
      });
      $('#register-form-link').click(function(e) {
          $("#register-form").delay(100).fadeIn(100);
          $("#login-form").fadeOut(100);
          $('#login-form-link').removeClass('active');
          $(this).addClass('active');
          e.preventDefault();
      });
  });
  </code></pre>