|
Change text on mouseover
Im new to this forum and was wondering if anyone would mind helping me out.
Im attempting to modify some code i found here through google to be used to change a welcome screen to 4 different languages besides english.
heres the code
<code>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<style type="text/css">
.hide {
display:none;
}
.show {
display:inline;
}
</style>
<script type="text/javascript">
if(window.addEventListener){
window.addEventListener('load',showlinks,false);
}
else {
if(window.attachEvent){
window.attachEvent('onload',showlinks);
}
}
function showlinks() {
lis=document.getElementById('nav').getElementsByTagName('li');
for(c=0;c<lis.length;c++){
lis[c].onmouseover=function() {
this.getElementsByTagName('span')[0].className='hide';
this.getElementsByTagName('span')[1].className='show';
}
lis[c].onmouseout=function() {
this.getElementsByTagName('span')[0].className='show';
this.getElementsByTagName('span')[1].className='hide';
}
}
}
</script>
</head>
<body>
<ul id="nav">
<li>
<span>[Closed]</span>
<span class="hide"><a href="http://www.codingforums.com/">codingforums.com</a></span>
</li><li>
<span>[Closed]</span>
<span class="hide"><a href="http://www.google.com/">google.com</a></span>
</li><li>
<span>[Closed]</span>
<span class="hide"><a href="http://www.bbc.co.uk/">bbc.co.uk</a></span>
</li><li>
<span>[Closed]</span>
<span class="hide"><a href="http://w3c.org/">w3c.org</a></span>
</li>
</ul>
</body>
</html>
</code>
As far as i can tell, if i just add the correct number of span id's it should work, or is there a different code i must plug in to get it to switch to the different languages.
|