Skip to content

Instantly share code, notes, and snippets.

@victorzen
Last active October 17, 2016 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorzen/e677877bb203699e8927cbba1aa3d62a to your computer and use it in GitHub Desktop.
Save victorzen/e677877bb203699e8927cbba1aa3d62a to your computer and use it in GitHub Desktop.
Error message disappears when clicked or after a few seconds

Paste the following code in the Javascripts section of your page selecting 'Before Body End Tag' as the placement:

<script>
  $(function(){
    $(".lp-form-errors").click(function(){
      $(".lp-form-errors").fadeOut()
    }); 
    $('.lp-pom-form .lp-pom-button').click(function(){
    
    //Change the time it takes for the error message to dissapear here (the time is in milliseconds)
      setTimeout(function(){$(".lp-form-errors").fadeOut()},6000)
    })
  });
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment