Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can someone figure this out?

0 views
Skip to first unread message

Sean Dolan

unread,
Jan 22, 2001, 5:20:01 PM1/22/01
to
Below is a very small "tree" sample. I am trying to use CSS, DHTML and
JavaScript to get the effect of a Windows Explorer interface. The problem
is that when you open the 2nd leg of a tree, it opens, but then closes the
first leg. The code below if copied to a HTM file will show you what I am
talking about.

Thanks for any help!
Sean

========================================================
<ul>
<li onclick="toggle('custom', this);">
<a href="yep.asp">Custom Info</a></li>

<div id="custom" style="display:none;">
<ul>
<li onclick="toggle('custom2', this);">
<a href="/adm/custom_ticket_templates.asp">Tickets</a></li>
<div id="custom2" style="display:none;">
<ul>
<li>
Something
</li>
</ul>
</div>
<li>
<a href="/adm/custom_registration.asp">Registration</a>
</li>
</ul>
</div>
</ul>

<script ="JavaScript">
<!--
function toggle( targetId, x ){


target = document.all( targetId );
if (target.style.display == "none"){
target.style.display = "";
x.style.listStyleImage='url(/graphics/minus.gif)';
} else {
target.style.display = "none";
x.style.listStyleImage='url(/graphics/plus.gif)';
}

}
file://-->
</script>


David R. Quinones

unread,
Mar 8, 2001, 3:18:11 PM3/8/01
to
I played around with your code and it looks like if you want to keep the
nodes expanded just add

window.event.cancelBubble = true;

as the first line in your function. That keeps the event from bubbling up
to the parent.

hope this helps.
dq


"Sean Dolan" <se...@kewi.net> wrote in message
news:eNh4REMhAHA.844@tkmsftngp05...

0 new messages