Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Folding Tree Menu Change OnMouseover

Status
Not open for further replies.

itsita001

Programmer
Nov 6, 2002
21
IL
Hey, can anyone help me with a script that will change image of bullet onmouseover and return on mouse out for a folding tree menu.
Would be very thankful if you can help me out...

Here is the code of the tree menu:

<html>
</head>

<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font-weight:bold ;list-style-image:url(fold.gif)}
#foldon{cursor:pointer;cursor:hand ; font-weight:bold ;list-style-image:url(fold1.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language=&quot;JavaScript1.2&quot;>
<!--

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

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id==&quot;foldheader&quot;)
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id==&quot;foldheader&quot;||cur.id==&quot;foldinglist&quot;){
iscontained=(cur.id==&quot;foldheader&quot;)? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags(&quot;UL&quot;)[0]
if (foldercontent.style.display==&quot;none&quot;){
foldercontent.style.display=&quot;&quot;
cur.style.listStyleImage=&quot;url(open.gif)&quot;
}
else{
foldercontent.style.display=&quot;none&quot;
cur.style.listStyleImage=&quot;url(fold.gif)&quot;
}
}
}

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

//-->
</script>
</head>
<body style='margin-right: .5in;text-align:right; direction:rtl'>
<font face=&quot;Verdana&quot;>
<ul>
<li id=&quot;foldheader&quot; >one</li>
<ul id=&quot;foldinglist&quot; style=&quot;display:none&quot; style=&{head};>
<li><a href=&quot; <li><a href=&quot; News</a></li>
<li><a href=&quot; News</a></li>
</ul>
<li id=&quot;foldheader&quot;>Webmaster</li>
<ul id=&quot;foldinglist&quot; style=&quot;display:none&quot; style=&{head};>
<li><a href=&quot; Drive</a></li>
<li><a href=&quot; Kit</a></li>
<li><a href=&quot; </ul>
<li id=&quot;foldheader&quot;>Nested Example</li>
<ul id=&quot;foldinglist&quot; style=&quot;display:none&quot; style=&{head};>
<li><a href=&quot; 1</a></li>
<li><a href=&quot; 2</a></li>
<li id=&quot;foldheader&quot;>Nested</li>
<ul id=&quot;foldinglist&quot; style=&quot;display:none&quot; style=&{head};>
<li><a href=&quot; 1</a></li>
<li><a href=&quot; 2</a></li>
</ul>
<li><a href=&quot; 3</a></li>
<li><a href=&quot; 4</a></li>
</ul>
</ul>
</font>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top