473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

onmouseout getElementById text change

1
Hi there.
Currently encountering slight problems regarding a bit of javascript im using on a page im designing. Must warn though that my scripting skills are rather neglectable....

Im using this bit of code (it's a script ive downloaded)
Expand|Select|Wrap|Line Numbers
  1.  
  2. <script>
  3. <!--
  4. var content=new Array()
  5. content[0]='<div class="menu"><div align="center"><b>Welkom</b></div><ul><a href="index.php?id=welkom&sub=welkom"><li>Home</li></a><a href="index.php?id=welkom&sub=nieuws"><li>Nieuws</li></a></ul></div>'
  6. content[1]='<div class="menu"><div align="center"><b>Organisatie</b></div><ul><a href="index.php?id=organisatie&sub=organisatie"><li>Wie zijn wij?</li></a><a href="index.php?id=organisatie&sub=wat"> <li>Wat doen wij?</li></a><a href="index.php?id=organisatie&sub=visie"><li>Visie</li></a></ul></div>'
  7. content[2]='<div class="menu"><div align="center"><b>IGM</b></div><ul><a href="index.php?id=igm&sub=igm"><li>Wat is IGM?</li></a><a href="index.php?id=igm&sub=igm_belang"> <li>Waarom IGM?</li></a><a href="index.php?id=igm&sub=igm_bedrijfssport"><li>IGM en Bedrijfssport</li></a><a href="index.php?id=igm&sub=preventie"><li>Preventief of reactief?</li></a><a href="index.php?id=igm&sub=wetten"><li>Wetten & <br />regels</li></a></ul></div>'
  8. content[3]='<div class="menu"> <div align="center"><b>Diensten</b></div> <ul><a href="index.php?id=diensten&sub=aanpak"><li>Aanpak</li></a><a href="index.php?id=diensten&sub=mogelijkheden"><li>Diensten</li></a><a href="index.php?id=diensten&sub=kantoor"><li>Kantoor Oefeningen</li></a><a href="index.php?id=diensten&sub=producten"><li>Producten</li></a><a href="index.php?id=diensten&sub=referenties"><li>Referenties</li></a></ul></div>'
  9. content[4]='<div class="menu"> <div align="center"><b>Contact</b></div><ul><a href="index.php?id=contact&sub=contact"><li>Contact</li></a></ul></div>'
  10.  
  11.  
  12. function regenerate(){
  13. window.location.reload()
  14. }
  15. function regenerate2(){
  16. if (document.layers){
  17. appear()
  18. setTimeout("window.onresize=regenerate",450)
  19. }
  20. }
  21.  
  22. function changetext(whichcontent){
  23.  
  24. if (document.all||document.getElementById){
  25. cross_el=document.getElementById? document.getElementById("navcontainer"):document.all.descriptions
  26. cross_el.innerHTML='<font face="verdana">'+whichcontent+'</font>'
  27. }
  28. else if (document.layers){
  29. document.d1.document.d2.document.write('<font face="verdana">'+whichcontent+'</font>')
  30. document.d1.document.d2.document.close()
  31. }
  32.  
  33. }
  34.  
  35. function appear(){
  36. document.d1.visibility='show'
  37. }
  38.  
  39. window.onload=regenerate2
  40.  
  41.  
  42. //-->
  43. </script>
  44.  
  45.  
which is called into action from this bit of code
Expand|Select|Wrap|Line Numbers
  1. <a href="index.php?id=welkom&sub=welkom" onMouseOver="document.show0.src = 'images/menu/Menu_roze_welkom.gif'"onmouseout="document.show0.src='images/menu/Menu_grijs_welkom.gif'"> <img src="images/menu/Menu_grijs_welkom.gif" alt="W en M Bedrijfssport" name="show0" height="70" border="0" id="show0" onMouseOver="changetext(content[0])" /></a>
So far so good, changetext(content[]) is doing it's job. However on mouseout i'd like the script to check for the currently active part of "navcontainer" and load the related content[].

TO see this all in action go to bedrijfssport.com and mouseover the images on the left, you'll see the text changing in the upper right corner. The problem is that it stays changed and does not return to its original value.


I hope this makes sense....

Thanks in advance!
Oct 5 '07 #1
2 4113
pbmods
5,821 Expert 4TB
Heya, br4t. Welcome to TSDN!

If you're running low on whitespace, let me know and I'll send you some.

It makes your code easier to read, which also makes it more likely that somebody might want to take the time to decipher it and help you figure out how to solve your problem....
Oct 6 '07 #2
acoder
16,027 Expert Mod 8TB
There is an error in your code:

rechangetext2 is not defined. You haven't defined it anywhere.
Oct 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: relaxedrob | last post by:
Howdy All! I am really stuck with this one - I want to completely create a table within JavaScript and insert it into the document, with onMouseOut and onMouseOver handlers in the table rows. ...
3
by: Ryh | last post by:
I have the following scritpt. It hides div layer when mouse is out of the div layer. Inside DIV I have IFRAME box. Unfortuantely it does not work in Mozilla or IE 5.5. It hides div when cursor is...
12
by: Epetruk | last post by:
Hi all, I want a page where the contents of a table cell are replaced with an image when the mouse moves over the cell, and the text is restored when the mouse moves out. Here's the html for the...
6
by: Tom | last post by:
Hi, In the following code I have reproduced a problem in IE that is extremely annoying for my application. <html> <head> <script type="text/javascript">
2
by: Thevercad | last post by:
i had come across a problem trying to find an equivalent for onmouseleave for the netscape browser. I happened to find a thread in here, discussing the same problem, but with no solutions in the end....
2
by: Daz | last post by:
Hi everyone. I think my problem is a simple one, but I am completely baffled as to how to pull it off. I have a piece of code like so... document.write( "<img id=\"slideshow_toggle\"...
9
by: peashoe | last post by:
I need to create a javascript that not only changes a picture, but also the link: here is an example of what I need www.myweddingfavors.com/ I'm working on this website and have it half done:...
2
by: flash | last post by:
1-When the mouse is over the course title. Its description should appear. When it the mouse is out, the description should disappear. 2-when double click on a word, its color changes to...
7
by: fsalvador | last post by:
Hi, I am trying to figure it out how to to hide in onmouseout the select options of a form. Below is the code I got so far. It isn't working. Please help. Thanks <!DOCTYPE HTML PUBLIC...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.