Javascript rollovers - "highlighting" images??
How do I get an image to be highlighted? I know that I have to use two images but what about the code?
How do I get an image to be highlighted? I know that I have to use two images but what about the code?
Anonymous posted this at 02:29 — 15th October 1999.
They have: 5,633 posts
Joined: Jan 1970
INSERT BETWEEN <HEAD></HEAD> TAGS
<script language="JavaScript">
<!-- hide script from old browsers
// preload images
if (document.images) {
NAME_over = new Image(); NAME_over.src = "URL";
NAME_out = new Image(); NAME_out.src = "URL";
}
// mouse over script
function mouseOver(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "_over.src") ;
}
}
// mouse out script
function mouseOut(imgName) {
if (document.images) {
document[imgName].src=eval(imgName + "_out.src") ;
}
}
// end hiding from old browsers -->
</script>
INSERT WITHIN <BODY></BODY> TAGS
// use this for each image
<a href=""
onMouseOver="mouseOver('NAME')"
onMouseOut="mouseOut('NAME')"><img
name="NAME"
src="" alt=""
border="" height="" width=""
hspace="" vspace=""></a>
Make sure you have a unique image NAME for each image you use.
----------
[email protected]
http://go.to/hass
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.