丄諦啲仇魜ヤ
如 果 敌 人 让 你 生 气 , 那 说 明 你 没 有 胜 他 的 把 握!
posts - 6,comments - 56,trackbacks - 1
<%@ page language="java"  pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    
<head>
        
<title>My JSP 'index.jsp' starting page</title>
    
<style> 
        
<!-- 
        #foldheader
{
        cursor:hand ;
        font
-weight:bold ; 
        list
-style-image:url(fold.gif)
        }
 
         
        
//--> 
   </style>
   
<script type="text/javascript"> 
      
<!-- 

        var head
="display:''" 
        img1
=new Image() 
        img1.src
="fold.gif" 
        img2
=new Image() 
        img2.src
="open.gif" 

        function change()

            
if(!document.all) {
                
return ;
            }

            
if (event.srcElement.id=="foldheader"
                var srcIndex 
= event.srcElement.sourceIndex ;
                var nested 
= document.all[srcIndex+1] ;
            }

            
if (nested.style.display=="none"
                nested.style.display
='' ;
                event.srcElement.style.listStyleImage
="url(open.gif)";
             }
 
            
else 
                nested.style.display
="none" 
                event.srcElement.style.listStyleImage
="url(fold.gif)"
             }
 
        }
 
 
      document.onclick
=change ;

//--> 
</script>

    
</head>

    
<body>
        
<ul>
            
<li id="foldheader">
                Software
            
</li>
            
<ul id="foldinglist" style="display:none" style=&{head};>
                
                
<li id="foldheader">
                    Nested
                
</li>
                    
<ul id="foldinglist" style="display:none" style=&{head};>
                        
<li>
                            
<a href="#">nested 1</a>
                        
</li>
                        
<li>
                            
<a href="#">nested 2</a>
                        
</li>
                    
</ul>
                
            
</ul>
        
</ul>
        

    
</body>
</html>

posted on 2007-12-06 14:55 Crying 阅读(349) 评论(1)  编辑  收藏 所属分类: JavaScript和CSS

FeedBack:
# re: 树形菜单
2008-03-25 09:04 | Crying
http://www.blogjava.net/sitinspring/archive/2008/03/23/188005.html

很好的一个菜单列子  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: