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

Bit of help needed!

Thread title: Bit of help needed!
     
    Thread tools Search this thread Display Modes  
Prev Previous Post   Next Post Next
02-17-2007, 07:45 PM
#1
t0m is offline t0m
Status: Request a custom title
Join date: Jan 2005
Location: West Sussex, England
Expertise:
Software:
 
Posts: 2,829
iTrader: 21 / 100%
 

t0m is on a distinguished road

  Old  Bit of help needed!

Ok im just trying to show/hide a div - everything on this script is working perfect BUT i want it to be hidden when the page loads...(at the momment it shows by default).

Thanks for the help!

Code:
<html>

<head>
<title>Test!</title>

<script language=javascript type='text/javascript'>
document.onload=hidelayer;

function showdiv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideshow').style.visibility = 'visible';
}
else {
if (document.layers) { // Netscape 4
document.hideshow.visibility = 'visible';
}
else { // IE 4
document.all.hideshow.style.visibility = 'visible';
}
}
}
function hidediv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideshow').style.visibility = 'hidden';
}
else {
if (document.layers) { // Netscape 4
document.hideshow.visibility = 'hidden';
}
else { // IE 4
document.all.hideshow.style.visibility = 'hidden';
}
}
}


</script> 

</head>

<body>

<a href="javascript:hidediv()">hide div</a>
<a href="javascript:showdiv()">show div</a>

<div id="hideshow">
My content test, please hide show!
</div>
</body>

</html>

     


Currently Active Users Viewing This Thread: 3 (0 members and 3 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