Javascript. 1st define your images:
Code:
if document.images(){
1st = new Image
2nd = new Image
1st and 2nd can be any name you like for easy reference. No spaces like dogOn and dogOff to help you remember which is mouse over and which is mouse off. Next define the image path or the actual picture.
Code:
1st.src="images/pic1.gif"
2nd.src="images/pic2.jpg"
Now define with an else statement if the browser doesn't understand the initial document.images.
Code:
else {
1st=""
2nd=""
The whole javascript code in the header of your page should now look something like this:
Code:
<script language="javascript" type="text/javascript">
<!-- Hide
if document.images(){
1st = new Image
2nd = new Image
1st.src="images/pic1.gif"
2nd.src="images/pic2.jpg"
}
else{
1st=""
2nd=""
document.affectedArea="" //This specifies the object to affect.
}
//End-->
</script>
In the body of your page, with the text or image you want to activate the rollover do this:
Code:
<a href="newpage.htm" onMouseover="document.affectedArea.src=2nd.src" onMouseout="document.affectedArea.src=1st.src">Next Page</a>
The area this affects can be any where on the page. All you have to do is associate the name of the area. In this case the name we gave it was affectedArea. But this can be anything.
Code:
<img border="0" src="images/anotherPic" name="affectedArea">
This is the picture that will change on the link rollover.
Hope this makes sense. Try coping the script from here. Paste into notepad first. Then you can paste into the HTML view of frontpage.
DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic