關於層和表的應用(一)

        傻子這次進行的網站,運用了不少層和表的綜合應用,這中間,我也從最初的找源代碼開始進行的,經過不斷的改進改進再改進,基本上已經能實用了,傻子現在將進行這些過程簡單的描述下來,以求以後更進一步。
        下面的是我最初用的示例:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="aleft.aspx.cs" Inherits="Admin_Admin_left" % > 

<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd" > 

<html > 
<head > 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" > 
<title > </title > 
<script language=javascript > 
function menuShow(obj,maxh,obj2) 

  
if(obj.style.pixelHeight <maxh) 
  

    obj.style.pixelHeight
+=maxh/10
obj.filters.alpha.opacity
+=20
obj2.bgcolor
="green"
    
if(obj.style.pixelHeight==maxh/10
  obj.style.display
= 'block '
myObj
=obj; 
myMaxh
=maxh; 
myObj2
=obj2; 
setTimeout( 
'menuShow(myObj,myMaxh,myObj2) '''); 
  }
 
}
 
function menuHide(obj,maxh,obj2) 

  
if(obj.style.pixelHeight >0
  

    
if(obj.style.pixelHeight==maxh/5
  obj.style.display
= 'none '
    obj.style.pixelHeight
-=maxh/5
obj.filters.alpha.opacity
-=10
obj2.bgcolor
="black"
myObj
=obj; 
myMaxh
=maxh 
myObj2
=obj2; 
setTimeout( 
'menuHide(myObj,myMaxh,myObj2) '''); 
  }
 
  
else 
    
if(whichContinue) 
  whichContinue.click(); 
}
 
function menuChange(obj,maxh,obj2) 

  
if(obj.style.pixelHeight) 
  

    menuHide(obj,maxh,obj2); 
whichOpen
= ' '
whichcontinue
= ' '
  }
 
  
else 
    
if(whichOpen) 

  whichContinue
=obj2; 
      whichOpen.click(); 
}
 
else 

  menuShow(obj,maxh,obj2); 
  whichOpen
=obj2; 
  whichContinue
= ' '
}
 
}
 
</script > 
   
<script language=javascript > 
  var whichOpen
=""
  var whichContinue
= ' '
       
</script > 
</head > 
<body leftmargin="0" topmargin="0" bgcolor="#FF9800" > 
       
<table cellSpacing=0 cellPadding=0 width=158 align=center > 
         
<tbody > 
         
<tr style="CURSOR: pointer" > 
             
<td class=menu_title id=menuTitle2  
          onmouseover
="this.className= 'menu_title2 ';"  
          onclick
=menuChange(menu2,30,menuTitle2);  
          onmouseout
="this.className= 'menu_title ';"  
          bgcolor
=blue  
            height
=25 > <span ></span >  </td > 
           
</tr > 
         
<tr > 
             
<td valign="middle"  >  
               
<div class=sec_menu id=menu2  
            style
="DISPLAY: none; FILTER: alpha(Opacity=0); WIDTH: 158px; HEIGHT: 0px" > 
                 
<table  cellSpacing=2 cellPadding=0 width=135 align=center > 
                   
<tr >  
                     
<td style="height: 25px" > <a href="#" target="BoardList" >ccc </> </td > 
                   
</tr > 
                      
<tr >  
                     
<td style="height: 25px" > <a href="#" target="BoardList" >ddd </> </td > 
                   
</tr > 
                 
</table > 
               
</div > </td > </tr > </tbody > </table > 
       
<br > 
       
<table cellSpacing=0 cellPadding=0 width=158 align=center > 
         
<tbody > 
           
<tr style="CURSOR: pointer" >  
             
<td class=menu_title id=menuTitle4  
          onmouseover
="this.className= 'menu_title2 ';"  
          onclick
=menuChange(menu4,30,menuTitle4);  
          onmouseout
="this.className= 'menu_title ';"  
           bgcolor
=blue  
            height
=25 > <span ></span >  </td > 
           
</tr > 
           
<tr >  
             
<td valign="middle" >  <div class=sec_menu id=menu4  
            style
="DISPLAY: none; FILTER: alpha(Opacity=0); WIDTH: 158px; HEIGHT: 0px" >  
                 
<table  cellSpacing=2  cellPadding=0 width=135 align=center >            
                  
<tr >  
                       
<td style="height: 25px" > <a href="#" target="BoardList" >aaa </> </td > 
                     
</tr > 
                      
<tr >  
                       
<td style="height: 24px" > <a href="#" target="BoardList" >bbb </> </td > 
                     
</tr > 
                   
                 
</table > 
               
</div > </td > 
           
</tr > 
         
</tbody > 
       
</table >            
</body >    
</html
本示例的功能大家代碼考進去看看就知道了,主要就是形成一個主菜單,主菜單下有幾個子菜單,點擊主菜單就彈出子菜單項,本代碼問題也嚴重,在火狐下不能運行。明天我將發下其一改進型。
         
       
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章