Free Scripts |
|
How to Create Image Rollovers in JavaScript: Step 2b by Christopher Heng
That's it. No other code modifications are needed. Notice
that the functions buttondown() and buttonup() have not been
modified. They will work with your other buttons as long as you
follow the pattern given above in naming your up and down buttons.
You're not limited to "about" and "home" buttons of
course. You can add as many buttons as you need by following the
procedure outlined above. Limitations
The code above requires JavaScript 1.1 and above to
execute. This means that if your visitor is using a browser prior to
Netscape 3.0 or Internet Explorer 4.0, they will not be able to view
your rollovers. The links, however, will still work
correctly when clicked (even on browsers with JavaScript disabled or
with no JavaScript support at all). This is important since
mouseover effects are purely cosmetic, and you don't want them to
detract from the overall functionality of your site.
Note that you should probably also make sure that the
files you use for the buttons are small. If your files are too big,
the image rollovers (or mouse-overs) will not have the smooth effect
of buttons popping up and down that you intend.
Finally, like all web page graphics, use your
discretion in implementing mouse-over images on your site. Excessive
use of rollover images will add to the overall load time of your web
pages, and, if you are on a commercial web host, increase your
bandwidth costs.
Copyright 2001 by Christopher Heng.
All rights reserved. Get more free tips and articles like this,
on web design, promotion, revenue and scripting, from http://www.thesitewizard.com/
|
|