|
| |
javascript visibility toggle, always starts "visible" instead of "hidden"
View related threads:
(in this forum
| in all forums)
|
Logged in as: Guest
|
|
|
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
|
|
|
|
C4RASHy
Posts: 5 Joined: 5/7/2009 Status: offline
|
RE: javascript visibility toggle, always starts "v... - 5/7/2009 0:24:08
So, how do i add a button that turns the text (thats inside the div class) visible?
|
|
|
|
C4RASHy
Posts: 5 Joined: 5/7/2009 Status: offline
|
RE: javascript visibility toggle, always starts "v... - 5/9/2009 3:01:37
thank You a big lot! That code helped me a lot. Im using it in the menu of my site. Can You please tell me how i get more Divs to appear when I click the link? I tried with onclick="toggle_visibility('div1');" onclick="toggle_visibility('div2');" and onclick="toggle_visibility('div1'); ('div2')" and onclick="toggle_visibility('div1', 'div2');" but those didnt work. Help me please!
|
|
|
|
C4RASHy
Posts: 5 Joined: 5/7/2009 Status: offline
|
RE: javascript visibility toggle, always starts "v... - 5/10/2009 7:23:52
i didnt quite understand that, dude. Can you give an example?!? plox
|
|
|
|
michaelea
Posts: 143 Joined: 11/9/2007 From: Cannon Beach, US West Status: offline
|
RE: javascript visibility toggle, always starts "v... - 5/17/2009 3:20:14
quote:
ORIGINAL: C4RASHy i didnt quite understand that, dude. Can you give an example?!? plox <div id="clickablediv">Lorem Ipsum etc.... <div id="div2">More Latin....</div> <div id="div3">Maybe some Gaelic now......</div> <!-- comment: this closes the clickablediv --></div> ? Not sure but I think that might have been what you were asking....
< Message edited by michaelea -- 5/17/2009 3:42:29 >
_____________________________
I wish I could design websites.... http://www.cannonbeachcomputers.com
|
|
|
|
michaelea
Posts: 143 Joined: 11/9/2007 From: Cannon Beach, US West Status: offline
|
RE: javascript visibility toggle, always starts "v... - 5/17/2009 3:41:38
and, how on earth does this post get fortytwoandahalfthousand hits ??? Is there that many people having JS visibility issues out there?????
_____________________________
I wish I could design websites.... http://www.cannonbeachcomputers.com
|
|
|
|
C4RASHy
Posts: 5 Joined: 5/7/2009 Status: offline
|
RE: javascript visibility toggle, always starts "v... - 5/17/2009 6:42:53
I have 2 divs and one link. Imagine: --- Here is DIV1 Here is link Here is DIV2 --- i want both div1 and div2 to get visible when I click the link thank You
|
|
|
|
C4RASHy
Posts: 5 Joined: 5/7/2009 Status: offline
|
RE: javascript visibility toggle, always starts "v... - 5/17/2009 7:16:19
I need: Here is div1 content Here is the link (outside any divs) Here is div2 content
|
|
|
|
michaelea
Posts: 143 Joined: 11/9/2007 From: Cannon Beach, US West Status: offline
|
RE: javascript visibility toggle, always starts "v... - 5/17/2009 7:19:08
Sorry I couldn't help...
_____________________________
I wish I could design websites.... http://www.cannonbeachcomputers.com
|
|
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
|
|
|