带隐藏功能的菜单导航

本文介绍了一个使用ASP.NET实现的网页布局方案,通过内嵌的C#代码及JavaScript实现了页面元素的动态显示与交互功能,包括左栏的显示隐藏、按钮点击事件等。

1.如图:

2.代码如下:

Code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Leasear.LeaWeb.Default" %>

<html>
<head runat="server">
    
<title>Untitled Page</title>

    
<script src="inc/FineMessBox/js/common.js" type="text/javascript"></script>

    
<script src="inc/FineMessBox/js/subModal.js" type="text/javascript"></script>

    
<style type="text/css">
        BODY
        
{}{
            font-size
: 12px;
            font-family
: "Verdana" , "Arial" , "细明体" , "sans-serif";
        
}

        table
        
{}{
            font-size
: 12px;
            font-family
: "Verdana" , "Arial" , "细明体" , "sans-serif";
        
}

    
</style>
</head>
<body scroll="no" onbeforeunload="return CloseEvent();" leftmargin="0" topmargin="0"
    marginheight
="0" marginwidth="0">
    
<form id="form1" runat="server">
    
<div>
        
<table id="TableMain" border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
            
<tr>
                
<td id="Header" width="100%" height="25" colspan="3" style="border-bottom: 1px solid #000000">
                    
&nbsp;
                    Header
</td>
            
</tr>
            
<tr>
                
<td id="frmTitle" nowrap="nowrap" valign="middle" align="center" width="180" style="height: auto;
                    border-right: 1px solid #000000"
>
                    
<iframe name="BoardTitle" style="height: 100%; visibility: inherit; width: 180; z-index: 2"
                        scrolling
="auto" frameborder="0" src="Left.aspx"></iframe>
                
</td>
                
<td style="width: 7pt" bgcolor="#7898A8" width="10" title="关闭/打开左栏">
                    
<img border="0" src="images/Menu/close.gif" id="menuimg" alt="隐藏左栏" onmouseover="javascript: menuonmouseover();"
                        onmouseout
="javascript: menuonmouseout();" onclick="javascript:switchSysBar()"
                        style
="cursor: hand" width="11" height="76" />
                
</td>
                
<td style="width: 100%">
                    
<iframe id="mainFrame" name="mainFrame" style="height: 100%; visibility: inherit;
                        width: 100%; z-index: 1"
 scrolling="auto" frameborder="0" src="Right.aspx"></iframe>
                
</td>
            
</tr>
            
<tr>
                
<td colspan="3" height="20">
                    
<table cellpadding="0" cellspacing="0" border="0" height="20" width="100%">
                        
<tr bgcolor="Black">
                            
<td width="200px">
                            
</td>
                            
<td style="padding-right: 50px">
                                
<button name="xsubmit" class="down_tools_button" onclick="javascript:showPopWin('About','About.aspx',510, 170, null,false)">
                                    
&nbsp;版本信息</button>
                                
<button name="xsubmit" class="down_tools_button" onclick="javascript: window.mainFrame.location.href='Right.aspx'">
                                    回到首页
</button>
                                
<button name="xsubmit" class="down_tools_button" onclick="javascript: window.top.location.href = 'Logout.aspx'">
                                    
&nbsp;退出系统</button>
                                
<button name="xsubmit" class="down_tools_button" onclick="javascript:window.open('http://framework.supesoft.com/help/');">
                                    
&nbsp;帮助手册</button>
                            
</td>
                        
</tr>
                    
</table>
                
</td>
            
</tr>
        
</table>
    
</div>
    
</form>
</body>
</html>

<script language="javascript" type="text/javascript">

function switchSysBar(){

     
if (document.all("frmTitle").style.display=="none"
     
{
        document.all(
"frmTitle").style.display=""
        menuimg.src
="images/Menu/close.gif";
        menuimg.alt
="隐藏左栏"
        }

    
else {
        document.all(
"frmTitle").style.display="none"
        menuimg.src
="images/Menu/open.gif";
        menuimg.alt
="开启左栏"
     }

     
     

}


 
function menuonmouseover(){
         
if (document.all("frmTitle").style.display=="none"{
         menuimg.src
="images/Menu/open_on.gif";
         }

         
else{
         menuimg.src
="images/Menu/close_on.gif";
         }

 }

 
function menuonmouseout(){
         
if (document.all("frmTitle").style.display=="none"{
         menuimg.src
="images/Menu/open.gif";
         }

         
else{
         menuimg.src
="images/Menu/close.gif";
         }

 }

 
     
if(top!=self)
    
{
        top.location.href 
= "default.aspx";
    }

var gDefaultLogin = "inc/finemessbox/loading.html";  
</script>


 

 

转载于:https://www.cnblogs.com/Tonyyang/archive/2008/01/18/1044652.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值