JAVA涂鸦
关于JAVA的点点滴滴
posts - 50,  comments - 689,  trackbacks - 0
< html >
< head >
< metdiv  http-equiv ="Content-Type"  content ="text/html; charset=gb2312"   />
< script  language ="JavaScript"  type ="text/javascript" >
var  curr = null ;
var  hs = new  Array();
var  ps = new  Array();

function  getElementsByClassName(clsName) 

    
var  arr  =   new  Array(); 
    
var  elems  =  document.getElementsByTagName( " * " );
    
for  (  var  cls, i  =   0 ; ( elem  =  elems[i] ); i ++  )
    
{
        
if  ( elem.className  ==  clsName )
        
{
            arr[arr.length] 
=  elem;
        }

    }

    
return  arr;
}

function  initFaq() {
    
var  faq = document.getElementById( " faq " );
    hs
= getElementsByClassName( " D_title " );
    ps
= getElementsByClassName( " D_content " );
    
for  ( var  i = 0 ;i < hs.length;i ++ ) {
        hs[i].id
= 'a_syy_' + i;
        ps[i].id
= hs[i].id + '_x';
        
        hs[i].onclick
= function () {
            
if  (curr != null && curr != this .id) {
                document.getElementById(curr
+ " _x " ).style.display = 'none';
                document.getElementById(curr).style.backgroundImage
= 'url(images / hide.gif)';
                document.getElementById(curr).style.backgroundColor
= '#E6B18C';
            }

            
var  s = document.getElementById( this .id + " _x " ).style;
            s.display
= ((s.display == 'none') ? 'block':'none');
            
if  (s.display != 'none') {
                curr
= this .id;
                
this .style.backgroundImage = 'url(images / show.gif)';
                
this .style.backgroundColor = '#FF8C3C';
            }

            
else {
                curr
= null ;
                
this .style.backgroundImage = 'url(images / hide.gif)';
                
this .style.backgroundColor = '#E6B18C';
            }

        }

        hs[i].onmouseover
= function () {
            
this .style.backgroundColor = " #E69860 " ;
        }

        hs[i].onmouseout
= function () {
            
this .style.backgroundColor = (document.getElementById( this .id + " _x " ).style.display == 'none') ? " #e6b18c " :'#FF8C3C';
        }

        hs[i].style.cursor
= 'pointer';
        ps[i].style.display
= 'none';
        }

}

</ script >

< style >
body
{
    margin
: 0 ;
    background
: url(images/diary.gif) no-repeat right bottom ;
}

#faq
{
    width
: 567px ;
    list-style
: none ;
    padding
: 0 ;
    margin
: 1px ;
}

#faq li
{
    width
: 100% ;
    margin
: 0 ;

}

#faq .D_title
{
    width
: 100% ;
    height
: 22px ;
    color
: #7455E8 ;
    font
: 400 12px/22px tahoma ;
    display
: block ;
    margin-top
: 1px ;
    text-decoration
: none ;
    background
: #E6B18C url(images/hide.gif) no-repeat 5px center ;
}


#faq .D_content
{
    width
: 100% ;
    height
: 250px ;
    font
: 12px/18px tahoma ;
    color
: #F26D4D ;
    background
: #E6E9FF ;
    margin
: 0 ;
}

</ style >
</ head >
< body  onload ="initFaq()" >
    
< ul  id ="faq"  style ="background:#fff;" >
    
< li >
    
< div  class ="D_title"  href ="#" >   2005-11-8      星期一             晴 </ div >
        
< div  class ="D_content" >
        
</ div >
    
</ li >
    
< li >
        
< div  class ="D_title"  href ="#" >   2005-11-8      星期二             晴 </ div >
        
< div  class ="D_content" >
        
</ div >
    
</ li >
    
< li >
        
< div  class ="D_title"  href ="#" >   2005-11-8      星期三             晴 </ div >
        
< div  class ="D_content" >
        
</ div >
    
</ li >
    
< li >
        
< div  class ="D_title"  href ="#" >   2005-11-8      星期四             晴 </ div >
        
< div  class ="D_content" >
        
</ div >
    
</ li >
    
< li >
        
< div  class ="D_title"  href ="#" >   2005-11-8      星期五             晴 </ div >
        
< div  class ="D_content" >
        
</ div >
    
</ li >
    
< li >
        
< div  class ="D_title"  href ="#" >   2005-11-8      星期六             晴 </ div >
        
< div  class ="D_content" >
        
</ div >
    
</ li >
    
< li >
        
< div  class ="D_title"  href ="#" >   2005-11-8      星期天             晴 </ div >
        
< div  class ="D_content" >
        
</ div >
    
</ li >
</ ul >
</ body >
</ html >
posted on 2007-04-01 16:45 千山鸟飞绝 阅读(465) 评论(0)  编辑  收藏 所属分类: JavaScript

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


网站导航:
 
正在阅读:



<2024年12月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

常用链接

留言簿(35)

随笔档案

文章分类

文章档案

好友的blog

我的其他blog

老婆的Blog

搜索

  •  

积分与排名

  • 积分 - 773341
  • 排名 - 56

最新评论

阅读排行榜

评论排行榜