|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
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> <a href="http://www.x.com">x</a></li> <li> <a href="http://www.y.com">y</a></li> <li> <a href="http://www.z.com">z</a></li> </ul> <li id="foldheader">FolderB</li> <ul id="foldinglist" style="display:none" style=&{head};> <li> <a href="http://www.x.com">x</a></li> <li> <a href="http://www.y.com">y</a></li> <li> <a href="http://www.z.com">z</a></li> </ul> <li id="foldheader">FolderC</li> <ul id="foldinglist" style="display:none" style=&{head};> <li> <a href="http://www.x.com">x</a></li> <li> <a href="http://www.y.com">y</a></li> <li> <a href="http://www.z.com">z</a></li> </ul> <li id="foldheader">FolderD</li> <ul id="foldinglist" style="display:none"> <li> <a href="http://www.x.com">x</a></li> <li> <a href="http://www.y.com">y</a></li> <li> <a href="http://www.z.com">z</a></li> </ul> </ul> </font> </body> </html> |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > automatically closing a folder when others are clicked |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|