Created
May 13, 2010 00:55
-
-
Save navarr/399351 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <style> | |
| html * | |
| { | |
| font-family: sans-serif; | |
| } | |
| body * | |
| { | |
| padding: 0; | |
| margin: 0; | |
| } | |
| h1 | |
| { | |
| padding: 0; | |
| margin: 0; | |
| font-size: 12pt; | |
| font-weight: bold; | |
| } | |
| body | |
| { | |
| font-size: 10pt; | |
| } | |
| </style> | |
| <script> | |
| function changeLinks() | |
| { | |
| for(var i = 0;i < document.getElementsByTagName("a").length;i++) | |
| { | |
| ele = document.getElementsByTagName("a")[i]; ele.target = "_blank"; | |
| } | |
| } | |
| function detectClick(e) | |
| { | |
| var rightclick; | |
| if(!e) var e = window.event; | |
| if(e.which) rightclick = (e.which == 3); | |
| else if (e.button) rightclick = (e.button == 2); | |
| if(rightclick) { self.close(); } | |
| } | |
| </script> | |
| </head> | |
| <body onload="document.timeout = setTimeout(self.close,5000);changeLinks();" onmouseover="clearTimeout(document.timeout);" onmouseout="document.timeout = setTimeout(self.close,5000);" onmouseup="detectClick();"> | |
| <h1>Title</h1> | |
| <p>Text</p> | |
| </body> | |
| </html> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This creates a notification that looks exactly like the default (non-HTML) notifications, with an added bonus. This notification disappears after five seconds (unless hovered over, at which point it disappears five seconds after the mouse is moved off of it or if it is right-clicked)