我有所有如下因素代码不同的ID和三个div的不同ID的显示或隐藏的div点击
<asp:Label ID="CA" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="10pt" style="padding-top:6px;" ForeColor="#CCCCCC" Height="100%" Text="Current Activities" onmouseover="var b = ChangeColorCA(); this.style.cursor='pointer'; return b" onmouseout="RemoveColorCA()"></asp:Label>
这里三个标签是所有
<div id="DIV_CA" runat=server align="center" visible="false" style="background-color:#f3f3f3; text-align: left; width: 500px; height: 470px; overflow:auto;">Some data</div>
我想DIV代码从标签点击制作显示或隐藏机制任何人都可以告诉我,我怎样才能做到这一点,当我点击一个标签,然后一个特定的div应该显示,其他人应该隐藏,当我点击下一个标签时,它的coresspondent div应该显示。
更新 这是我的脚本代码
<script type="text/javascript">
function hideshow(span) {
var div = document.getElementById("DIV_" + span.id);
if (div.style.display == "none")
div.style.display = "block";
else
div.style.display = "none";
}
</script>
这里是lablel代码
<asp:Label ID="CA" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="10pt" style="padding-top:6px;" ForeColor="#CCCCCC" Height="100%" Text="Current Activities" onmouseover="var b = ChangeColorCA(); this.style.cursor='pointer'; return b" onmouseout="RemoveColorCA()" onclick="hideshow(this)" ></asp:Label>
好的检查更新 – 2012-01-07 10:55:49
是的它使所有的标签大胆,但当我点击下一个标签时没有把它们变成正常 – 2012-01-07 13:14:57
YEs我已经复制了上面的代码 – 2012-01-07 13:17:30