473,385 Members | 1,769 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,385 software developers and data experts.

Collapsable content

Does anybody know how the following can be acheived using html or
xhtml?

I need to present colleagues with a 'to-do' list. Lets say the list
has ten or so jobs and each job consists of five or so steps, most
colleagues will already know how to perform a number of these jobs, so
rather than show all jobs with all steps, by default, I'd like to have
the steps for each job collapsed.

Colleagues who didn't know how to perform a particular job could click
some kind of toggle button to expand that job and view the tasks, when
done, they could click the toggle button again and have the tasks
collapsed.

It's important the tasks are expanded in-line (on the same page), i.e.
just follwing a link to another page is no good - they have to appear
together. Maybe I need to create a whole new document using XSL which
has the expanded content also?

Thanks for any ideas!

Duncan Smith.

May 4 '06 #1
6 4211
On 4 May 2006 09:07:32 -0700, "Duncan" <DS********@googlemail.com>
wrote:
I need to present colleagues with a 'to-do' list. <snip>Colleagues who didn't know how to perform a particular job could click
some kind of toggle button to expand that job and view the tasks, when
done, they could click the toggle button again and have the tasks
collapsed.

It's important the tasks are expanded in-line (on the same page), i.e.
just follwing a link to another page is no good - they have to appear
together. Maybe I need to create a whole new document using XSL which
has the expanded content also?


Try something like this:

<html>
<head>
<script language=javascript>
function ToDoList(todoitem) {
if (document.all) {
thisItem = eval("document.all." + todoitem + ".style")
if (thisItem.display == "block") {
thisItem.display = "none"
}
else {
thisItem.display = "block"
}
return false
}
else {
return true
}
}
</script>
<style type="text/css">
#Hold {display:none; margin-left:0px}
#Tilt {display:none; margin-left:0px}
#Drink {display:none; margin-left:0px}
</style>
</head>
<body>
<a href="#" onClick="return ToDoList('Hold')">Step 1</a>
<br>
<span id="Hold">Hold beer mug to your mouth.</span>
<a href="#" onClick="return ToDoList('Tilt')">Step 2</a>
<br>
<span id="Tilt">Tilt the beer mug.</span>
<a href="#" onClick="return ToDoList('Drink')">Step 3</a>
<br>
<span id="Drink">Swallow...</span>
</body>
</html>
May 4 '06 #2
Thanks. That's pretty cool, hic, but it only seems to work with
Internet Explorer and not Firefox.

Also, for many 'to-do' lists to share common 'tasks', would it be
possible to bring in the content from another html file? In other
words, the expansion would be content from another html file but it
would appear inline (in this html file).

Cheers,

Duncan Smith.

May 4 '06 #3
On 4 May 2006 14:03:41 -0700, "Duncan" <DS********@googlemail.com>
wrote:
Thanks. That's pretty cool, hic, but it only seems to work with
Internet Explorer and not Firefox.
Mmm. I never tried it in FireFox...
Also, for many 'to-do' lists to share common 'tasks', would it be
possible to bring in the content from another html file? In other
words, the expansion would be content from another html file but it
would appear inline (in this html file).


Put the content of each 'task' into a seperate .html page then
"include" each page into the main .htm page using an iframe:

The original example code I posted would now look something like this:

<html>
<head>
<script language=javascript>
function ToDoList(todoitem) {
if (document.all) {
thisItem = eval("document.all." + todoitem + ".style")
if (thisItem.display == "block") {
thisItem.display = "none"
}
else {
thisItem.display = "block"
}
return false
}
else {
return true
}
}
</script>
<style type="text/css">
#Hold {display:none; margin-left:0px}
#Tilt {display:none; margin-left:0px}
#Drink {display:none; margin-left:0px}
</style>
</head>
<body>
<a href="#" onClick="return ToDoList('Hold')">Step 1</a>
<br>
<span id="Hold">
<iframe scrolling=No frameborder=0 marginheight=0 marginwidth=0
width=350 height=50 SRC="content1.htm"></iframe>
</span>
<a href="#" onClick="return ToDoList('Tilt')">Step 2</a>
<br>
<span id="Tilt">
<iframe scrolling=No frameborder=0 marginheight=0 marginwidth=0
width=350 height=50 SRC="content2.htm"></iframe>
</span>
<a href="#" onClick="return ToDoList('Drink')">Step 3</a>
<br>
<span id="Drink">
<iframe scrolling=No frameborder=0 marginheight=0 marginwidth=0
width=350 height=50 SRC="content3.htm"></iframe>
</span>
</body>
</html>

Obviosuly you'd have to adjust the sizes of the iframes according to
the size of your content...

Then create a .htm page for each of your "topics":

Content page 1:
<html>
<body>
<p>Your content for item 1 goes in this .htm page...</p>
</body>
</html>

Content page 2:
<html>
<body>
<p>Your content for item 2 goes in this .htm page...</p>
</body>
</html>

Content page 3:
<html>
<body>
<p>Your content for item 3 goes in this .htm page...</p>
</body>
</html>

May 5 '06 #4
On 4 May 2006 09:07:32 -0700, in comp.infosystems.www.authoring.html ,
"Duncan" <DS********@googlemail.com> in
<11**********************@j73g2000cwa.googlegroups .com> wrote:
Does anybody know how the following can be acheived using html or
xhtml?

I need to present colleagues with a 'to-do' list. Lets say the list
has ten or so jobs and each job consists of five or so steps, most
colleagues will already know how to perform a number of these jobs, so
rather than show all jobs with all steps, by default, I'd like to have
the steps for each job collapsed.

Colleagues who didn't know how to perform a particular job could click
some kind of toggle button to expand that job and view the tasks, when
done, they could click the toggle button again and have the tasks
collapsed.

It's important the tasks are expanded in-line (on the same page), i.e.
just follwing a link to another page is no good - they have to appear
together. Maybe I need to create a whole new document using XSL which
has the expanded content also?

Thanks for any ideas!


Try Accordion: http://openrico.org/rico/demos.page?demo=rico_accordion
--
Matt Silberstein

Do something today about the Darfur Genocide

http://www.beawitness.org
http://www.darfurgenocide.org
http://www.savedarfur.org

"Darfur: A Genocide We can Stop"
May 8 '06 #5
Thanks, that's a good nudge in the right direction.

May 18 '06 #6
Once upon a time *Duncan* wrote:
Thanks, that's a good nudge in the right direction.


Huh? What and who are you talking about?

How to quote: http://www.netmeister.org/news/learn2quote.html#toc2
From Google: http://www.safalra.com/special/googlegroupsreply/

Google Group Users, read about The Usenet Improvement Project:
http://blinkynet.net/comp/uip5.html

--
/Arne

Proud User of SeaMonkey. Get your free copy:
http://www.mozilla.org/projects/seamonkey/
May 18 '06 #7

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

Similar topics

2
by: news | last post by:
Is there a way to write an XML doc so that you can still format the text, bold and whatnot, and still have it display in a collapsable tree format? Here's what I'm using as a test: <?xml...
0
by: Steve | last post by:
Visual Studio 2003 .NET / C# My current application has a Treeview control down the left hand edge permanently, and this object acts as my main menu controller. What I want though is for this...
3
by: The Bear | last post by:
Is there a way to create a collapsable datagrid. Where multiple areas of the grid can be expanded or collapsed? Using C# and Windows Forms
1
by: Brian Henry | last post by:
How do you make a collapsable list in html? I remember doing it in the past but cant remember how exactly to.. thanks!
7
by: Rlrcstr | last post by:
How would one implement collapsable paragraphs of text in an HTML page? I want the sections of the document to be expandable for full text or collapsed into just the section heading. Any help is...
1
by: t f | last post by:
Hi Is there a collapsable panel available in c#, e.g. like the toolbox / solution explorer etc... Or would one have to develop one? thanks t f
12
by: Mark | last post by:
Hi I'm looking to create a colapsable list like what we see in a news reader or on a forum. - Basically, any number of levels up to 10 (i.e. more than whats likely to be needed) - Able to...
4
by: cleary1981 | last post by:
Hi, I am using php to generate an xml file with information from my database. What I want to do is style xml into an expandable collapsable table where the user will only see the childnodes if...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...

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.