Okay guyz! i'm having a problem and it doesn't seem like its that hard. Okay i have a button composed of 3 different pictures in a table. I have other buttons as well and when you click on one of them the button is highlighted navy or dark blue to tell which link you are at. The script works great with onclick and that is what i want it to do. The only thing now is I want to keep this method, but when the page loads i need for the button background to be blue and be able to change to the original color light blue(or 669Aff). So when you load the page you already know where you're at and when you click on another button the backgrounds of the button change. the one you clicked is now navy(or 000066) and the previous button was navy is now 669aff). I hope i didn't make this to complicated. any help is appreciated thanks.
<style>
.original { background-color: #669AFF; }
.linkAt { background-color: #000066; }
</style>
<script language="javaScript">
var prevTable = "";
function ChangeColor(TableAt){
if (prevTable != ""){prevTable.className = 'original'}
ChangeBack = document.getElementById(TableAt);
ChangeBack.className='linkAt'
prevTable = ChangeBack;
}
</script>
<table id="t3" class=original onClick="ChangeColor('t3')"(this works it interchanges the colors back and forth, but when the page loads i one to already show the link navy (000066) onLoad="ChangeColor('t3')"(this part doesn't--perhaps there is something else i could use) >
<tr>
<td><img src="../img/BulletLeft.gif" border="0"></td>
<td><a
href="http://courses.cslab.utpb.edu/current/se44602/iteration3/nestedindex.htm"
TARGET="menuandmain"><img src="../img/iteration3Button.jpg" alt="iteration3 button"
width="120" height="40"/></a></td>
<td><img src="../img/BulletRght.gif" border="0"></td>
</tr>
</table>
if you still don't know what i'm talking about email! sorry about that!!!



Reply With Quote


Bookmarks