我写了一个自定义放在panel里
求一段JS代码
需求界面中有个btn按钮
点击btn让panel显示出来
简单说Js就是点击btn控制panel的Visible 

解决方案 »

  1.   

    $('#btnId').click(function(){
          $('#panelId').show();
    })
      

  2.   


    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="DisableButton.WebForm1" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    <script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript">
    function   click() 
              { 
                  var   panel1=document.getElementById( "Panel1 ");              
                  panel1.visible=true; 
                  }
    </script>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
         <input type="button" id="btnTest" Text="按钮" onclick="click()" />
    </div>
    </form>
    </body>
    </html>
      

  3.   

    panel1.style.display=""如果在服务器端不能设置 visible=“false”  只能先设置panel 的style dispaly为“none”