weixin_33699914 2012-10-02 14:26 采纳率: 0%
浏览 38

jQuery AJAX fadeIn内容[重复]

This question already has answers here:
                </div>
            </div>
            <div class="grid--cell mb0 mt8">Closed <span title="2012-10-03 06:04:45Z" class="relativetime">7 years ago</span>.</div>
        </div>
    </aside>

Possible Duplicate:
Making my ajax updated div fade in

I want the content from AJAX call to fadeIn on my page, but when I use this code $('#sub_container').html(content).fadeIn(); it doesn't work, even if I set the animation speed to super slow (slow(5000))

$('.create').click(function(){
    loadingimg();
    document.title = 'Create Message';
    $.ajax({
        url: 'create.php',
        dataType: 'html',
        success: function(content){
            $('#sub_container').html(content);
            // $('#sub_container').html(content).fadeIn(); <- Fails
        }
    });
});
</div>
  • 写回答

2条回答 默认 最新

  • python小菜 2012-10-02 14:29
    关注

    The .fadeIn() function essentially makes the element visible, so will appear to do nothing if the element is already visible. You can ensure that's not the case by hiding the element:

    $('#sub_container').hide().html(content).fadeIn();
    
    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?