collapsible lists in FrontPage

  • Thread starter Thread starter FontPage novice
  • Start date Start date
I have Googled my text but cannot seem to find what I am looking for. I
viewed your website and it is exactly what I am looking for except I'm not
sure how you set it up in FrontPage. Is there some sort of link I need to
insert?
 
Hi

The code is entered into the Code view of FrontPage. So you would need to
copy the code from http://tandcl.homemail.com.au/sitemap.html and amend it
to suit your purposes

The <head> section needs the JS
<script type="text/javascript">
function showVisible(i,hide) {
var sign = (hide) ? "plus" : "minus"
document.images["image" + i].src = "images/display/" + sign + ".gif"
document.getElementById("ulist" + i).style.display = (hide!='hide') ?
"block" : "none"
} //------------------------------

function ExpandAll(hide) {
var i = 0
while (document.images["image" + (++i)])
showVisible(i,hide)
} //------------------------------

function changeVisibility(i) {
var hide = (document.images["image" + i].src.match(/^.+minus\.gif$/)) ?
'hide' : ''
showVisible(i,hide)
} //------------------------------
</script>

In the <body> section you need to copy my structure of the list elements,
i.e. those with the <li> tag. This is a typical one:
<li>
<a href="javascript:changeVisibility(6);">
<img src="images/display/plus.gif" alt="" id="image6" width="15"
height="15" /></a>
<a href="index.html">Trevor and Carole's Home Page (index.html)</a>
<ul id="ulist6">
<li><img src="images/display/smfile.gif" alt="" /><a
href="abcnews.html">ABC News</a></li>
<li><img src="images/display/smfile.gif" alt="" /><a
href="bbcnews.html">BBC News</a></li>
</ul>
</li>

In this group, there are two <li> elements which collapse, viz "ABC News"
and "BBC News". These must be enclosed by the tags <ul ></ul>, and the id
numbers must match all the way. That is the "6" must appear in
<a href="javascript:changeVisibility(6);">
<img src="images/display/plus.gif" alt="" id="image6" width="15"
height="15" /></a>
<ul id="ulist6">

You also need the + and - gifs which you can get from
http://tandcl.homemail.com.au/images/display/plus.gif and
http://tandcl.homemail.com.au/images/display/minus.gif. Store these on the
same folders in your web, i.e
http://yourweb.com/images/display/plus.gif and
http://yourweb.com/images/display/minus.gif.

If you need any more help, please post a link to a web page, whether it is
working or not
 
Back
Top