jQuery的prePEND +淡入 [英] jquery prepend + fadeIn

查看:148
本文介绍了jQuery的prePEND +淡入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个code:

$.ajax({
        url : url,
        data : {ids : JSON.stringify(jsonids), hotel_id: hotel_id},
        success : function(response)
        {
            $('#be-images ul').prepend(response).fadeIn('slow');
        },
        dataType: 'html'
    });

但淡入没有工作...我想要的内容为prepended和褪色的......我怎么会做这个?

but the fade In does not work...I want the content to be prepended and faded in...how will I do this?

在此先感谢!

推荐答案

假设响应的HTML那么试试这个:

Assuming response is HTML then try this:

$(response).hide().prependTo("#be-images ul").fadeIn("slow");

当你做这种方式:

$('#be-images ul').prepend(response).fadeIn('slow');

你实际上衰落的事情是最初的选择清单(在前面),这已经是可见的结果。

the thing you're actually fading in is the result of the initial selector (the list at the front), which is already visible.

这篇关于jQuery的prePEND +淡入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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