Mouseover- Multiple AlertsA script that will bring up multiple alerts when someone moves the mouse over a link. It is set up for three alerts, but more could be added.Script CodeGrab a copy of the file below and place it in the same directory as the Web page on which you will use the script (if you wish to place the script file in a different directory you will need to make the necessary adjustments to the src attribute of the script tag that calls it).The code below should be placed between the <body> and </body> tags where you want the link to appear. ExampleA working sample of the script is shown below.OptionsThe link text can be changed to whatever you like by editing the text between the <a> and </a> tags.You can change the destination of the link to send the viewer someplace if JavaScript turned off by editing the src attribute of the <a> tag. You can change the text of the alerts by opening the salert1.js file and editing the bold (strong) text on the following lines of code:
window.alert('I told you not to click the link!'); Additional alerts can be added by adding additional window.alert statements:
window.alert('I told you not to click the link!'); If you need to use single or double quotation marks within a quote, you should write them with a backslash before them (i.e. \" and \') in order to avoid JavaScript errors. AccessibilityThis should be more or less accessible as long as the link has a destination for the viewer to go to if activated with the keybord or with JavaScript turned off (or if the viewer's browswer is too old for the script). If the messages are important, the link should go to a page which includes the important information.It should be noted that this script can be quite irritating and probably should be avoided by professional sites unless absolutely necessary. |