JavaScript Auto-collapsing Notification Panel

Note (2025): This article was originally written in 2009. The example code (inline onclick, manual style.display changes) reflects practices of that era. Modern JavaScript uses event listeners, unobtrusive DOM manipulation, and CSS transitions. The post is kept here as an archive and for historical interest. In almost all web applications comes the moment when it becomes necessary to show some notifications to the user. A common practice in the past, even when elegance was unimportant and web pages didn’t show much dynamic behavior, was the use of the method alert() from JavaScript. ...

May 29, 2009 · 1 min · Andrea Azzola