回 帖 发 新 帖 刷新版面

主题:谁有办法利用javascript脚本控制一个Panel的显示、隐藏?


谁有办法利用javascript脚本控制一个Panel的显示、隐藏?在后台处理太麻烦了!

回复列表 (共2个回复)

沙发

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="CombinePics.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<script language="javascript">
function showPanel()
{
    document.getElementById('Panel1').style.display = "";
}
function closePanel()
{
    document.getElementById('Panel1').style.display = "none";
}
</script>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<img src="image.aspx">
<asp:Panel id="Panel1" style=" Z-INDEX: 101; LEFT: 32px; POSITION: absolute; TOP: 288px" runat="server" Width="322px" Height="107px" BackColor="Olive">Panel</asp:Panel>
<a href="javascript:showPanel()">showDiv</a>
<a href="javascript:closePanel()">hideDiv</a>
</form>
</body>
</HTML>

板凳

谢谢,我试了一个多小时都没搞定,呵呵!

我来回复

您尚未登录,请登录后再回复。点此登录或注册