Click to See Complete Forum and Search --> : set image script


opus99x
01-07-2003, 05:27 PM
I found a javascript called set image, I need to know if I can replace the images with text files. It's at http://javascript.internet.com/miscellaneous/set-image.html If anyone can help me please e-mail me at opus99x@hotmail.com.

Thanks
Greg

swon
01-07-2003, 05:46 PM
For changing some text onMouseover, you can do it this way:

<html>
<head>
<script language=javascript>
function changeText(NewTxtNumber){
var texts = new Array("Your default Text","Text Number 1","Text Number 2")
obj = document.getElementById("changetext");
obj.innerHTML = texts[NewTxtNumber];
}

</script>
</head>
<body onLoad="changeText(0)">
<a href="yourfile.html" onMouseover="changeText(1)" onMouseout="changeText(0)">new Text1</a>
<a href="yourfile2.html" onMouseover="changeText(2)" onMouseout="changeText(0)">new Text2</a>
<br>
<br>
<div id=changetext></div>
</body>
</html>