1

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');

Is it possible ?

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");
                        }


                    }
        });
Shahin
  • 12,543
  • 39
  • 127
  • 205

2 Answers2

1

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

Soren
  • 14,402
  • 4
  • 41
  • 67
1

Yes, you can, but your object must be hidden initially, so do:

obj.hide().html(msg.d).show('slow');

Hope this helps. Cheers

Edgar Villegas Alvarado
  • 18,204
  • 2
  • 42
  • 61