我正在使用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