将HTML添加到具有效果jQuery的Div中 [英] Add Html to Div with effect jQuery
本文介绍了将HTML添加到具有效果jQuery的Div中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将Ajax请求中的Loaded html添加到Div生效(例如,向下滑动).
我正在使用此代码,但尚未生效:
I want to add Loaded html from Ajax request to Div with effect (for example slide down).
I am using this code but it doesn't have effect yet :
obj.html(msg.d).show('slow');
有可能吗?
更新:这是我的完整代码:
Update : this my full code:
$.ajax({
type: "POST",
url: options.webServiceName + "/" + options.renderUCMethod,
data: options.ucMethodJsonParams,
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: true,
success:
function (msg) {
var html = msg.d;
obj.html(msg.d).show('slow');
// if specified make callback and pass element
if (options.completeHandler)
options.completeHandler(this);
},
error:
function (XMLHttpRequest, textStatus, errorThrown) {
if (options.errorHandler) {
options.errorHandler(this);
} else {
obj.html("error");
}
}
});
推荐答案
应该工作-我假设"obj"是a,您可以尝试将其分为两个,以确保您没有任何有趣的东西继续.
Should work -- I assume that "obj" is a , you can try to split it up into two just to make sure you don't have anything funny going on.
$(obj).html(msg.d);
$(obj).show(500); // 500 ms animation time
$(obj).html(msg.d);
$(obj).show(500); // 500 ms animation time
这篇关于将HTML添加到具有效果jQuery的Div中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文