title: JQuery shake effect on error
body: <p>I'm trying to apply a shake effect to my login page when a user enters incorrect information. At the minute, if a user submits incorrect details, the page is refreshed a PHP notification is printed and the notification div is made visible via JS. I'm trying to use the notification becoming visible as recognition that the information is incorrect and toggle the shake effect.</p>
  
  <p>HTML </p>
  
  <pre><code>&lt;div class="form-container"&gt;
      &lt;form action="index.php" method="post"&gt;
          &lt;div class="logo"&gt;&lt;/div&gt;
          &lt;p&gt;
              Sign into &lt;i&gt;Agito&lt;/i&gt; by using the credentials you were sent via email. If you haven't signed up yet, click the link below. 
          &lt;/p&gt;
  
          &lt;div class="pre-user"&gt;
              &lt;img src="../resources/img/user.png"&gt;
          &lt;/div&gt;
          &lt;input type="text" placeholder="Username" name="username"/&gt;
          &lt;div class="pre-pass"&gt;
              &lt;img src="../resources/img/password.png"&gt;
          &lt;/div&gt;
          &lt;input type="password" placeholder="Password" name="password"/&gt;
          &lt;a href="#"&gt;Haven't signed up yet?&lt;/a&gt;
          &lt;input type="submit" value="Sign in"/&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>with the following being printed when the page reloads</p>
  
  <pre><code>&lt;div class='notification'&gt;Sign in unsuccessful. Try again?&lt;/div&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>$('document').ready(function() {
      $('.notification').hide();
      $('.notification').slideDown();
      if ($('.notification').is(':visible')) {
          $('.form-container').effect( "shake" );
      }
  });
  </code></pre>