473,325 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Revealing hidden html text

I have a <div> section of text in my page that I want to make visible
via an input check box associated with an OnClick javascript.
I can do this OK but the problem is that the space for the hidden text
is reserved on the page (i.e. thare is a gap). The user clicks the
button to make the text visible or not visible.
What I really want is for the page to expand (open up) to reveal the
text if the user checks the box and contracts again if the box is
unchecked. Much neater.
Here are the important bits of the code so far :-

<style type="text/css">.hidden { position: relative; visibility:
hidden; }</style>

.............

<SCRIPT LANGUAGE="JavaScript">

function set(What,Value)
{

if (document.layers && document.layers[What] != null)
document.layers[What].visibility = Value;
else
if (document.all)
eval('document.all.'+What+'.style.visibility ="'+ Value+'"');
}

function click1(Form,Radio,Layer)
{
vv = "visible"
hh = "hidden"
if (Form.C1.checked)
{set(Layer,vv);}
else
{ set(Layer,hh);}
}
</SCRIPT>

...........

<td align="left" valign="top" width="100%"><input type="checkbox"
name="C1" onClick="click1(this.form,this.name,'L1')" value="OFF"><div
class="hidden" id="L1"><ul><li>xxx</li><li>yyy</li></ul></div></td>
Can you help?
Thanks.
Jul 20 '05 #1
2 7522
Andrew hu kiteb:
I have a <div> section of text in my page that I want to make visible
via an input check box associated with an OnClick javascript.
I can do this OK but the problem is that the space for the hidden text
is reserved on the page (i.e. thare is a gap). The user clicks the
button to make the text visible or not visible.
What I really want is for the page to expand (open up) to reveal the
text if the user checks the box and contracts again if the box is
unchecked. Much neater.
Here are the important bits of the code so far :-

<style type="text/css">.hidden { position: relative; visibility:
hidden; }</style>


use the display stylesheet attribute instead of visibility. That way,
screen space is not reserved for the object.

--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #2
Can you expand a little on display stylesheet attribute - not familiar.

Thanks.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
6
by: calfliu | last post by:
hello: everybody! I have a simple question. How can I translate the selected value from art to recipient(hidden input button)? <form name="send" method="post" action="send.cgi"> <select...
6
by: GoCMS | last post by:
Hi, guys: I am trying debug other people(who has left company)'s ASP code, and had difficulty understanding the use of a hidden asp page. The application has an index page, like MyIndex.asp...
3
by: Roy Adams | last post by:
Hi I'm reposting this question because for some reason can't post follow up question to this thread. What I'm trying to do is put the value and text from a a select in to a text field and to a...
1
by: Madame Blablavatsky | last post by:
hello, i am trying to build a kind of very, very simple ritch text editor for people to use with a very simple cms. at the moment i am working on the basic structure. the text is put in an...
16
by: Ed Mullen | last post by:
I've investigated a bit how to have hidden lines of text (could be just text or could be links) appear when clicking on a link in an HTML page. Example describing what I'd like it to look like is...
17
by: ApexData | last post by:
Hello Split DB (FE & BE) Linked. FE compiled to MDE. For security reasons, I have hidden the BackEnd. However, If the network is down or the FE can't find the Backend, then an Access Error...
2
by: esteuart | last post by:
I need to get the right combination for a div to clip any text inside and allow vertical alignment. I only have this problem in FireFox. I have 3 divs nested within each other. The outer div has...
1
by: Jeff User | last post by:
hi all Using C#, .NET1.1. I need to pass a string of text to the final html output and then capture it with java script on the client side. I found that I can place my string in and then...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.