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 1622 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Hide and Show a Div Using Javascript

Thread title: Hide and Show a Div Using Javascript
     
    Thread tools Search this thread Display Modes  
Prev Previous Post   Next Post Next
11-24-2008, 08:37 PM
#1
Verayer is offline Verayer
Status: Member
Join date: Oct 2006
Location:
Expertise:
Software:
 
Posts: 151
iTrader: 1 / 100%
 

Verayer is on a distinguished road

  Old  Hide and Show a Div Using Javascript

Hi; I'm using the following javascript:

Code:
<script language="JavaScript">   
    function feat1() {
	  document.getElementById("featdisplay1").style.display = "block"
         document.getElementById("featdisplay2").style.display = "none";
  document.getElementById("featdisplay3").style.display = "none";
  document.getElementById("featdisplay4").style.display = "none"

}
function feat2() {
	  document.getElementById("featdisplay2").style.display = "block"
         document.getElementById("featdisplay1").style.display = "none";
  document.getElementById("featdisplay3").style.display = "none";
  document.getElementById("featdisplay4").style.display = "none"

}
function feat3() {
	  document.getElementById("featdisplay3").style.display = "block"
         document.getElementById("featdisplay2").style.display = "none";
  document.getElementById("featdisplay1").style.display = "none";
  	  document.getElementById("featdisplay4").style.display = "none"


}
function feat4() {
	  document.getElementById("featdisplay4").style.display = "block"
         document.getElementById("featdisplay2").style.display = "none";
  document.getElementById("featdisplay3").style.display = "none";
    document.getElementById("featdisplay1").style.display = "none";


}
</script>
my html code:
<div><p><a href="javascript:feat1();" >Donec </a></p></div>
<div id="featdisplay1">...</div>

<div><p><a href="javascript:feat2();" >Donec </a></p></div>
<div id="featdisplay2">...</div>

<div><p><a href="javascript:feat3();" >Donec </a></p></div>
<div id="featdisplay3">...</div>

<div><p><a href="javascript:feat4();" >Donec </a></p></div>
<div id="featdisplay4">...</div>

This works perfect in IE, but in Firefox he does not want to click the first link and I can only click each link once. (same for safari)

Does anyone know a solution for this,
thanks in advance

Reply With Quote
     


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