使我的ajax更新DIV渐显 [英] Making my ajax updated div fade in

查看:134
本文介绍了使我的ajax更新DIV渐显的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个code执行Ajax调用,每一个下拉列表改变时加载的成果转化为两个重复的div。我想要的结果被褪到分区,以提供一个更明显的迹象表明,事情已经改变,因为其如此浑然一体的,有时难以察觉的变化!

I have this code that performs an ajax call and loads the results into two duplicate divs every time a dropdown is changed. I want the results to be faded into the div, to give a more obvious indication that something has changed, as its so seamless its sometimes hard to notice the change!

print("$('.ajaxdropdown').change(function(){


		$.ajax({
			type: "GET",
			url: "/includes/html/gsm-tariff.php",
			data: "c_name="+escape($(this).val()),
			success: function(html){
    			$("#charges-gsm").html(html);
                                    //i want to fade result into these 2 divs...
				$("#charges-gsm-faq").html(html);
				$("#charges-gsm-prices").html(html);
			}
		});
	});");

我已经试过追加淡入方法和一些其他的东西,但没有喜悦。

I've tried appending the fadein method and a few other things, but no joy.

推荐答案

您将不得不隐藏()它之前,你可以使用淡入()

You'll have to hide() it before you can use fadeIn().

更新:下面是你如何做到这一点通过链接:

UPDATE: Here's how you'd do this by chaining:

$("#charges-gsm-faq").hide().html(html).fadeIn();
$("#charges-gsm-prices").hide().html(html).fadeIn();

这篇关于使我的ajax更新DIV渐显的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆