[英]slideDown incoming data in jquery AJAX
I am new into jQuery AJAX, so I apologize if the question is too obvious. 我是jQuery AJAX的新手,所以如果问题太明显我会道歉。
I have 2 webforms in ASP.NET, one is to add data into database, the other is to show data in ul-li format. 我在ASP.NET中有2个webforms,一个是将数据添加到数据库中,另一个是以ul-li格式显示数据。
So far I have succeed only the basic jQuery AJAX, whenever there is a new data, it is shown. 到目前为止,我只获得了基本的jQuery AJAX,只要有新数据,就会显示出来。
I want that whenever new data is added, it must be shown to the user as slideDown format. 我希望每当添加新数据时,它必须以slideDown格式显示给用户。
Note: I don't have any answer. 注意:我没有任何答案。 The answer below did not help.
下面的答案没有帮助。
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(document).ready(function () {
$.ajax({
url: 'WebForm1.aspx',
success: function (data) {
$("#Urunler").html("<li>" + data + "</li>");
}
});
});
</script>
<style>
td
{
width: 200px;
height: 30px;
background: yellow;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<ul id="Urunler" runat="server">
</ul>
</div>
</form>
</body>
</html>
Thank you very much. 非常感谢你。
You can do: 你可以做:
$("#Urunler").hide().html("<li>" + data + "</li>").slideDown();
Since your AJAX is on page-load, you can start with the UL hidden via CSS and remove that .hide()
, either way. 由于你的AJAX是在页面加载的,你可以从通过CSS隐藏的UL开始,并以任何一种方式删除
.hide()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.