blog内容的展开和隐藏是怎么实现的? XXX.style.display = "none";XXX.style.display = "block"; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不好意思,说错了.我是定义了一个<div>;后面有一个button,我点button的时候,怎么改变哪个div的样式. <body > <form id="form1" runat="server"> <div id="div1" style=" background-color:Blue; overflow:hidden; display: block; visibility: visible; clip: rect(100px 100px 100px 100px); width: 100px; position: static; height: 100px;"> sdfgsfg </div> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> </form></body>就是我怎么在下面这个事件中将visibility: visible;的值改变为:visibility:hidden? protected void Button1_Click(object sender, EventArgs e) { ????????????????????? } <input type=button value='button' onclick="var oDiv = document.getElementById('divname'); oDiv.style.display = (oDiv.style.display=='none') ? 'block' : 'none';" /> //aspx<html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>无标题页</title> <script type="text/javascript"> function show() { var oDiv = document.getElementById('div1'); oDiv.style.display = (oDiv.style.display=='none') ? 'block' : 'none'; return false; } </script></head><body > <form id="form1" runat="server"> <div id="div1" style=" background-color:Blue; overflow:hidden; display: block; visibility: visible; clip: rect(100px 100px 100px 100px); width: 100px; position: static; height: 100px;"> sdfgsfg </div> <asp:Button ID="Button1" runat="server" Text="Button" /> </form></body></html>//aspx.cs protected void Page_Load(object sender, EventArgs e) { Button1.Attributes.Add("onclick", "return show()"); } 页面之间传值 水晶报表动态绑定大数据量数据源时无法将数据加载到页面上(B/S结构) 关于createpopup()的弹出窗口效果问题 .net获取客户端机器环境变量 文本框问提 本人想做一个动态菜单,菜单项是从数据库里读出来的,有什么好建议吗? 新闻系统权限设计问题 这在<asp:Label>里面应该怎么写?? 数据库操作 "datediff" 我想在.NET的webform程序中,提取登录局域网中本机的用户名,如何提取? JS 和Vbscript能定义可变长度的数组吗? vs中页面浏览问题
我是定义了一个<div>;后面有一个button,我点button的时候,怎么改变哪个div的样式.
<form id="form1" runat="server">
<div id="div1" style=" background-color:Blue; overflow:hidden; display: block; visibility: visible; clip: rect(100px 100px 100px 100px); width: 100px; position: static; height: 100px;">
sdfgsfg
</div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</form>
</body>就是我怎么在下面这个事件中将visibility: visible;的值改变为:visibility:hidden?
protected void Button1_Click(object sender, EventArgs e)
{
?????????????????????
}
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
function show()
{
var oDiv = document.getElementById('div1');
oDiv.style.display = (oDiv.style.display=='none') ? 'block' : 'none';
return false;
}
</script>
</head>
<body >
<form id="form1" runat="server">
<div id="div1" style=" background-color:Blue; overflow:hidden; display: block; visibility: visible; clip: rect(100px 100px 100px 100px); width: 100px; position: static; height: 100px;">
sdfgsfg
</div>
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>//aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add("onclick", "return show()");
}