ubh
08-29-2005, 07:59 PM
Ok I need to have a nav bar with all 5 links to have a Mouseover/Mouseout script that changes my sites main logo.
So if someone moves over our about link, it changes the site logo to an about site logo, and back to the default logo when I move off the about link.
Here is the tutorial I am fallowing.
http://www.sitebuildingtools.com/magicbuttons.html
And here is the code I tested with.
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
// preload images:
if (document.images) {
clickme1 = new Image(75,22); clickme1.src = "clickme1.gif";
clickme2 = new Image(75,22); clickme2.src = "clickme2.gif";
}
function hiLite(imgName,imgObjName) {
if (document.images) {
document.images[imgName].src = eval(imgObjName + ".src");
}}
//--></SCRIPT>
</HEAD>
<BODY>
<A HREF="another.html"
onMouseOver="hiLite('img01','clickme2')"
onMouseOut="hiLite('img01','clickme1')"><IMG SRC="clickme1.gif" WIDTH="75" HEIGHT="22" BORDER="0" ALT="" NAME="img01"></A>
</BODY>
</HTML>
When I use this tutorials example clickme images it all works fine with my (HTML/Images located on my desktop)
But soon as I copy over the Images I want to work with to my desktop and change the code accordingly I get nothing but script errors.
Here is my changed code
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
// preload images:
if (document.images) {
clickme1 = new Image(75,22); TesterLogo0.src = "TesterLogo0.gif";
clickme2 = new Image(75,22); TesterLogo1.src = "TesterLogo1.gif";
}
function hiLite(imgName,imgObjName) {
if (document.images) {
document.images[imgName].src = eval(imgObjName + ".src");
}}
//--></SCRIPT>
</HEAD>
<BODY>
<A HREF="another.html"
onMouseOver="hiLite('img01','TesterLogo1')"
onMouseOut="hiLite('img01','TesterLogo0')"><IMG SRC="TesterLogo0.gif" WIDTH="75" HEIGHT="22" BORDER="0" ALT=""
NAME="img01"></A>
</BODY>
</HTML>
Why is this happening, and is anyone else haveing this problem?
So if someone moves over our about link, it changes the site logo to an about site logo, and back to the default logo when I move off the about link.
Here is the tutorial I am fallowing.
http://www.sitebuildingtools.com/magicbuttons.html
And here is the code I tested with.
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
// preload images:
if (document.images) {
clickme1 = new Image(75,22); clickme1.src = "clickme1.gif";
clickme2 = new Image(75,22); clickme2.src = "clickme2.gif";
}
function hiLite(imgName,imgObjName) {
if (document.images) {
document.images[imgName].src = eval(imgObjName + ".src");
}}
//--></SCRIPT>
</HEAD>
<BODY>
<A HREF="another.html"
onMouseOver="hiLite('img01','clickme2')"
onMouseOut="hiLite('img01','clickme1')"><IMG SRC="clickme1.gif" WIDTH="75" HEIGHT="22" BORDER="0" ALT="" NAME="img01"></A>
</BODY>
</HTML>
When I use this tutorials example clickme images it all works fine with my (HTML/Images located on my desktop)
But soon as I copy over the Images I want to work with to my desktop and change the code accordingly I get nothing but script errors.
Here is my changed code
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
// preload images:
if (document.images) {
clickme1 = new Image(75,22); TesterLogo0.src = "TesterLogo0.gif";
clickme2 = new Image(75,22); TesterLogo1.src = "TesterLogo1.gif";
}
function hiLite(imgName,imgObjName) {
if (document.images) {
document.images[imgName].src = eval(imgObjName + ".src");
}}
//--></SCRIPT>
</HEAD>
<BODY>
<A HREF="another.html"
onMouseOver="hiLite('img01','TesterLogo1')"
onMouseOut="hiLite('img01','TesterLogo0')"><IMG SRC="TesterLogo0.gif" WIDTH="75" HEIGHT="22" BORDER="0" ALT=""
NAME="img01"></A>
</BODY>
</HTML>
Why is this happening, and is anyone else haveing this problem?