不要工作"fadeOut",如果有"replaceWith". [英] don't work 'fadeOut' If there is 'replaceWith'.?

查看:76
本文介绍了不要工作"fadeOut",如果有"replaceWith".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我同时使用fadeOutreplaceWith时,不起作用fadeOut.但是,如果我只使用fadeOut,它就可以工作.我想一起使用它们的每个拖曳.在我的代码中如何?

When i use of fadeOut and replaceWith together, does not work fadeOut. but if i use only of fadeOut it worked. i want use of each tow they together. how is it in my code?

$.ajax({
        type: "POST",
        url: url,
        data: dataString,
        cache: false,
        success: function(html){
            var $html = $(html);
////////////////////////////////// here ////////////////////////////////
                    $('.ser_form #paginate input:checkbox:checked').parent().parent().fadeOut("slow");

                    $('#num_count').replaceWith($html.find('#num_count'));
                    $('tr#paginate').replaceWith($html.find('tr#paginate'));
                    $('.pagination').replaceWith($html.find('.pagination'));
////////////////////////////////// here ////////////////////////////////

        },

示例::您自己看到的

在上面的示例中,请检查行,然后单击DELETE进行查看.

EXAMPLE: Yourself see

In example above please check row and click on DELETE to see it.

推荐答案

在这里,我尝试模拟您的情况 http://jsfiddle.net/yY2AS/1/

Here i tried to simulate your scenario http://jsfiddle.net/yY2AS/1/

无论如何,您的问题对我来说不是很清楚...

your question was not very clear to me, anyway...

在发出"ajax请求"之前

before makeing the `ajax request do

$this = $('.ser_form #paginate input:checkbox:checked').parent().parent();

然后进行ajax调用(我猜ajax调用是为了删除和更新记录)

then make the ajax call(i am guessing that the ajax call is to delete and update record)

在成功回拨中做

success: function(html){
            $this.fadeOut("slow");
           //rest of the code

这篇关于不要工作"fadeOut",如果有"replaceWith".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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