Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1619 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Need javascript problem fixed =P

Thread title: Need javascript problem fixed =P
     
    Thread tools Search this thread Display Modes  
Prev Previous Post   Next Post Next
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?

     


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed