Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 30th, 2003, 10:06 AM
nurraj nurraj is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 1 nurraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy automatically closing a folder when others are clicked

i am having a hard time revising the code to automatically close the other folders when another folder is clicked. right now, they all remain open and requires reclicking to close. any help is appreciated! :D thank you!

/nurraj

--------------------------------------------------------------------


<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style>
<!--
#foldheader{
cursor:pointer;
cursor:hand;
font-weight:bold;
margin: 0;
padding: 0;
list-style-type: none;
font-size: xx-small;
line-height: 9pt;
}
#foldinglist{
margin: 0;
padding: 0;
list-style-type: none;}
//-->
</style>

<script language="JavaScript1.2">
<!--

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement

i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement))
{
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
}
else{
foldercontent.style.display="none"
}

}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>
</head>

<body>
<font face="Arial" size="1">
<ul>

<li id="foldheader">FolderA</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li>&nbsp;&nbsp;<a href="http://www.x.com">x</a></li>
<li>&nbsp;&nbsp;<a href="http://www.y.com">y</a></li>
<li>&nbsp;&nbsp;<a href="http://www.z.com">z</a></li>
</ul>

<li id="foldheader">FolderB</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li>&nbsp;&nbsp;<a href="http://www.x.com">x</a></li>
<li>&nbsp;&nbsp;<a href="http://www.y.com">y</a></li>
<li>&nbsp;&nbsp;<a href="http://www.z.com">z</a></li>
</ul>

<li id="foldheader">FolderC</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li>&nbsp;&nbsp;<a href="http://www.x.com">x</a></li>
<li>&nbsp;&nbsp;<a href="http://www.y.com">y</a></li>
<li>&nbsp;&nbsp;<a href="http://www.z.com">z</a></li>
</ul>

<li id="foldheader">FolderD</li>
<ul id="foldinglist" style="display:none">
<li>&nbsp;&nbsp;<a href="http://www.x.com">x</a></li>
<li>&nbsp;&nbsp;<a href="http://www.y.com">y</a></li>
<li>&nbsp;&nbsp;<a href="http://www.z.com">z</a></li>
</ul>
</ul>

</font>

</body>
</html>

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > automatically closing a folder when others are clicked


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap