View Single Post
11-26-2007, 11:56 PM
#1
querk is offline querk
Status: Junior Member
Join date: Nov 2007
Location:
Expertise:
Software:
 
Posts: 39
iTrader: 1 / 100%
 

querk is on a distinguished road

  Old  Need javascript problem fixed =P

Ok so I am new here as a registered user but I have been here several times before (over a year ago I probably have an old username).

I need help with my site, here is the problem and code.

Ok so I need a better working way to do this

Code:
  <a id="poTer" onclick="switchMenu('poTerms');switchMenu('poTerH'); switchMenuBack('poContent');switchMenuBack('poTer');this.innerHTML='Hide Terms';" /> Show Terms </a>  <a id="poTab" onclick="switchMenu('poContent');switchMenu('poTabH');switchMenuBack('poTerms');switchMenuBack('poTab');this.innerHTML='Hide Options';" /> Show Options </a>
  <a style="display:none;" id="poTerH" onclick="switchMenu('poTerms');switchMenu('poTer'); switchMenuBack('poContent');switchMenuBack('poTerH');this.innerHTML='Show Terms';" /> Hide Terms </a>  <a style="display:none;" id="poTabH" onclick="switchMenu('poContent');switchMenu('poTab');switchMenuBack('poTerms');switchMenuBack('poTabH');this.innerHTML='Show Options';" /> Hide Options </a>
Thats in the HTML file and this is in a js file

Code:
<!--
function switchMenu(obj) {
    var el = document.getElementById(obj);
    if ( el.style.display != "none" ) 
    {
        el.style.display = 'none';
    }
    else 
    {
        el.style.display = '';
    }
}
function switchMenuBack(obj) {
    var el = document.getElementById(obj);
    if ( el.style.display != "" ) 
    {
        el.style.display = 'none';
        el.class
    }
    else 
    {
        el.style.display = 'none';
    }
}
//-->
I need the bottons to when they are clicked change the text to hide or show depending on weather or not the box is showing. When show options is clicked the options show and when youthen click Show Terms options is hidden and Terms is shown vise versa.

Here is a live demo of how it is workign witht he current code.
http://privily.us/

Please?