Recommended sites: |
|
Andy's JavaScript tutorial 4
Ok, I'll dedicate this final tutorial to showing you some more advanced JavaScript applications, along with their complete source code, so you can simply cut and paste 'em to instantly "pump up" your site! This is a cool script that displays a "live" form clock on your web page:
Source code: <form name="time"> An image flip is a cool JavaScript effect that makes an image change to another when the mouse moves over it. Not very practical, but defintely cool: The above button consists of two images - one before the mouse is over it, and one after. Here's the source code: Source code: <a href="index.htm" onMouseover="if (document.images) document.images.menu.src='after.gif'" onMouseout="if (document.images) document.images.menu.src='before.gif'"><img src="before.gif" name="menu" border=0></a> Try pasting the above code onto your webpage, and change 'before.gif' and 'after.gif' to reflect your own images. Notice how I gave the image a name ('menu') using the name attribute. This is neccessary, and if you want to have multiple image flips on one page, you'll need to give each image flip a unique name. I'ms sure most of you have seen a drop down menu box before. They are <select> lists that go to the selected url when clicked on...a great space saver! <form name="c1"> You can cram in as many links as you wish into the box simply by adding more options to the selection list. Recommended JavaScript sites:
|