473,609 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FAQ-page => showing/hiding text

Hi,

I'm making a FAQ-page. To keep it a little synoptic, only the questions are
visible. When you klick on a certain question, the answer appears. You can
find an example at: http://www.aendekerk.be/zoom/uitklappen.htm

Suppose i click on "titel1", "tekst1" appears. When i click on "titel2",
"tekst2" appears. But also tekst1 remains visible. I don't want this. How
can i program this?

Thanks!

Dries
Jul 20 '05 #1
5 1225
Dré wrote on 09 feb 2004 in comp.lang.javas cript:
I'm making a FAQ-page. To keep it a little synoptic, only the
questions are visible. When you klick on a certain question, the
answer appears. You can find an example at:
http://www.aendekerk.be/zoom/uitklappen.htm

Suppose i click on "titel1", "tekst1" appears. When i click on
"titel2", "tekst2" appears. But also tekst1 remains visible. I don't
want this. How can i program this?


function openen(x) {
s='none'
document.getEle mentById('text1 ').style.displa y=s
document.getEle mentById('text2 ').style.displa y=s
document.getEle mentById('text3 ').style.displa y=s
document.getEle mentById('text4 ').style.displa y=s
document.getEle mentById('text5 ').style.displa y=s

document.getEle mentById(x).sty le.display=''
}
<div onclick="openen ('text1')">tite l van text1</div>
<div id="text1">.... .......</div>

niet getest, hoor.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2
Dré wrote:
Hi,

I'm making a FAQ-page. To keep it a little synoptic, only the questions are
visible. When you klick on a certain question, the answer appears. You can
find an example at: http://www.aendekerk.be/zoom/uitklappen.htm

Suppose i click on "titel1", "tekst1" appears. When i click on "titel2",
"tekst2" appears. But also tekst1 remains visible. I don't want this. How
can i program this?

Thanks!

Dries

Keep the ID of the opened question in a public variable, and on click of
an item first close the opened one.

--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Jul 20 '05 #3
> I'm making a FAQ-page. To keep it a little synoptic, only the questions are
visible. When you klick on a certain question, the answer appears. You can
find an example at: http://www.aendekerk.be/zoom/uitklappen.htm

Suppose i click on "titel1", "tekst1" appears. When i click on "titel2",
"tekst2" appears. But also tekst1 remains visible. I don't want this. How
can i program this?


I've found a solution on
http://www.dynamicdrive.com/dynamicindex1/navigate2.htm
Thanks anyway for replying!!

Dries

--
E-mail: dries <punt> aendekerk <ad> advalvas <punt> be

Jul 20 '05 #4
"Bas Cost Budde" <ba*@heuveltop. org> wrote in message
news:c0******** ***@news2.solco n.nl...
<snip>
Keep the ID of the opened question in a public variable,
and on click of an item first close the opened one.


Rather than saving the ID of the element that needs to be re-hidden as a
string in a global variable it would be more efficient to save a
reference to the element, or, better yet, its style object. It would
save having to re-locate the element within the DOM (getElementById is
not necessarily that fast). The script must have had that reference when
it made the element visible so it can just assign the reference at that
point, having defaulted the global variable to null. Then if the
variable refers to an object when it is time to make a different element
visible it is a simple matter to first render the stored element hidden.

Richard.
Jul 20 '05 #5
Richard Cornford wrote:
"Bas Cost Budde" <ba*@heuveltop. org> wrote in message
Keep the ID of the opened question in a public variable,
and on click of an item first close the opened one.
Rather than saving the ID of the element that needs to be re-hidden as a
string in a global variable it would be more efficient to save a
reference to the element, or, better yet, its style object.


Thanks. Showing my javascript age here :-)
--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Jul 20 '05 #6

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

Similar topics

6
1594
by: David Fisher | last post by:
In a recent message, "Re: Two questions about...something", Fred H wrote: >> This is covered in the FAQ. Please read FAQ before posting. >> > I have read the FAQ, and I search it quite often. But this time > I didn't know what to search for. Now I know that I could have > searched for "initializaion", and found FAQ 10.6, but hey, I can't > read the whole FAQ through every time I have a question, can I...? Just a thought ... how about...
0
291
by: Marshall Cline | last post by:
URL: http://www.parashift.com/c++-faq-lite/ Archive-name: C++-FAQ ============================================================================== Contents: Copying permissions http://www.parashift.com/c++-faq-lite/copy-permissions.html On-line sites that distribute this document
21
8159
by: Boris Ammerlaan | last post by:
This notice is posted about every week. I'll endeavor to use the same subject line so that those of you who have seen it can kill-file the subject; additionally, Supersedes: headers are used to ensure that only one copy resides on a given news server. This notice was last updated on March 9th, 2005, and is available (with a complete revision history) on the World Wide Web at http://www.stack.nl/~boris/HTML/ciwahfaq.html. Most of it was...
6
1951
by: Juan T. Llibre | last post by:
Welcome to the ASP.NET FAQ. The online version of this FAQ is at http://asp.net.do/faq/ Bookmark it! Thank you for reading this FAQ! Use it to improve your online experience. The Microsoft Public Newsgroups allow users of Microsoft products to exchange technical information and expertise. Please avoid personal attacks, slurs and profanity in your
19
1948
by: Dr John Stockton | last post by:
kelvlam <kelvlam@gmail.composted : The newsgroup FAQ has not been posted here for some considerable while. The latest version I know of is 8.1 - 2005-11-05 but I think the Web site serves 8.0 - 2004-03-15 We cannot expect new readers, especially those entering via Web pages, to know of the FAQ without a regular posting of something with a
7
2350
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How can I access the client-side filesystem? ----------------------------------------------------------------------- Security means that by default you can't. In a more restricted enviroment, there are options. For example, using LiveConnect to connect to Java with Netscape, and using the FileSystemObject in IE. Check http://groups.google.com/
56
2755
by: jacob navia | last post by:
This is what is there now (2006, 20 Dec) How can I do serial (``comm'') port I/O? It's system-dependent. Under Unix, you typically open, read, and write a device file in /dev, and use the facilities of the terminal driver to adjust its characteristics. (See also questions 19.1 and 19.2.) Under MS-DOS, you can use the predefined stream stdaux, or a special file like COM1, or some primitive BIOS interrupts, or (if you require decent...
28
1602
by: =?ISO-8859-15?Q?Juli=E1n?= Albo | last post by:
Hello. The welcome message of this group says: "The comp.lang.c++ FAQ is available at http://www.parashift.com/c++-faq-lite/" However, nothing in that FAQ mentions that is FAQ of this newsgroup, it calls itself "the C++ FAQ Lite". And the current thread about the usages and others in the past shows that the document in question does not
20
1254
by: FAQEditor | last post by:
FAQ Version 9.86 Dated 2007-10-03 has been uploaded. Most changes are cosmetic and some typo corrections. -- Randy comp.lang.javascript FAQ - http://jibbering.com/faq/index.html FAQ Notes: http://www.jibbering.com/faq/faq_notes/faq_notes.html ECMAScript Language Specification via FAQ2.6
0
8127
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8567
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8527
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8215
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5509
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4015
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2529
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.