navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

javascript visibility toggle, always starts "visible" instead of "hidden"

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> javascript visibility toggle, always starts "visible" instead of "hidden"
Page: [1]
 
phillipu

 

Posts: 86
Joined: 12/12/2001
From: Seattle WA USA
Status: offline

 
javascript visibility toggle, always starts "visib... - 5/10/2004 15:21:06   
Hi all, I am using some javascript to toggle the visibility of a table, the toggle is working fine, my prob is that whenever the page with the toggle loads, it loads my table as "visible", i need the page to load with the table to toggle as "hidden", then the user can click the text link and the table becomes "visible".

Here is the javascript code -

<script language="JavaScript">
function toggle(target, iNo)
{
	obj=document.getElementById(target+String(iNo));
	obj.style.display=( (obj.style.display=='none') ? '' : 'none');
}
</script>


this code is the onclick for the toggle -

<td bgcolor="#F4F4F4" width="540" class="data" onClick="toggle('status',1)" id="rfcpe_status" style="cursor:hand">


this code is the table that is toggled -

<table width="700" border="0" cellspacing="2" cellpadding="2" bgcolor="#FFFFFF"  id="status1">


Thanks,

Phillip
Giomanach

 

Posts: 6115
Joined: 11/19/2003
From: England
Status: offline

 
RE: javascript visibility toggle, always starts "v... - 5/11/2004 8:12:32   
You will need to use CSS rather than JavaScript for this. It's much easier:)

The coding would be :

<head>
<style type="text/css">
#invis{
visibilty: hidden;
}
</style>

Then you would need:

<div id="invis">
<table>
.......The Invisble Table.......
</table>
</div>

HTH

Dan

_____________________________




(in reply to phillipu)
Page:   [1]

All Forums >> Web Development >> General Web Development >> javascript visibility toggle, always starts "visible" instead of "hidden"
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts