Created
January 5, 2021 21:01
-
-
Save LouisdeBruijn/43e332a58a548f39626de004c29c4af8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // logging key-value pairs of FormData object | |
| function logFormData(data) { | |
| for (const pair of data.entries()) { | |
| console.log(pair[0] + ": " + pair[1]); | |
| } | |
| } | |
| // fade out message alerts | |
| function fade_alerts() { | |
| alerts = document.getElementsByClassName("alert msg"); | |
| var i = alerts.length; | |
| for (let elem of alerts) { | |
| i--; | |
| time = 3250+(1000*i); | |
| setTimeout(function() { | |
| $(elem).fadeOut("slow"); | |
| }, time); | |
| } | |
| } | |
| // call fade out after DOMContentLoaded | |
| window.addEventListener('DOMContentLoaded', (event) => { | |
| fade_alerts(); | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment