我正在使用JQuery 1.5.2。ASP.NET中的JQUERY .show()函数
虽然使用.show函数,但它仅显示元素的一部分,类似0.3秒,然后元素再次隐藏自身。这与所有其他形式一致。我究竟做错了什么?
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.5.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#Button1').click(function() {
$('#clickmeupdate').show(function() {
});
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<span style="background-color:Blue; display: none" id="clickmeupdate" >Click me to update</span>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
</body>
</html>
我不使用ASP的服务器控件,但我有点猜测按钮上的'runat =“server”'进入了它...... – 2011-04-02 18:05:37
我认为TJ在这里有一个要点。查看“查看源代码”按钮ID可能会有所不同。这就是使用ClientId属性引用Id的情况。 – 2011-04-02 18:08:03
欢呼队友,asp控件不工作,但html工作正常 – user478636 2011-04-02 18:09:29