I want to display some text when a user clicks my menu selections.
Table 1 = The menu
Table 2 = where the text is to be displayed.
Inside Table 2 I have e.g: (the text is hidden by default)
<div id="someText1" style="display:none;"> This is the text. Lots of text </div>
Inside Table 1 I have
<a href=# onMouseDown="show('someText1'); return true;"> Menu Item 1 </a>
This works with the follwing script:
function flip(foo) {
//document.getElementById(foo).style.visibility="hidden";
if( document.getElementById(foo).style.display == "none") {
document.getElementById(foo).style.display="block";
} else {
document.getElementById(foo).style.display="none";
}
}
function show(foo) {
document.getElementById(foo).style.display="block";
return true;
}
function hide(foo) {
document.getElementById(foo).style.display="none";
return true;
}
===========================================
*Now*, I have 5 menu items, and a lot of text is to be displayed for each of them. I want to avoid having a mile long webpage (in code that is) and I want to try not to create 5 different html pages.
Is there a way where I can retrieve the text from somewhere and display it to the user WITHOUT reloading the page????
I tried using variables and document.write function.... kind of worked, but then only the text was displayed, and nothing else of the page (new page with text).
How can I solve this??
**********************************************
CSS PROBLEM.
This works. (External file)
.MenuText
{
color: #4488E9;
font-size: 75%;
font-weight: bold;
text-decoration: none
}
a:link { text-decoration: none; color: #4488E9 }
a:hover { color: #1329D0; font-weight: bold }
This doesn't work.
a.MenuText:link { text-decoration: none; color: #4488E9 }
a.MenuText:hover { color: #1329D0; font-weight: bold }
Comments?
***************************************
Hope I explained myself good enough. Any suggestions appreciated!
Steven