开发者

How to animate dynamically generated html in jquery

开发者 https://www.devze.com 2023-03-29 04:29 出处:网络
I\'m fetching tabular data from the server using jquery\'s ajax function. And I\'m using the .html function to assign the fetched data inside a div with an id of list_forms.

I'm fetching tabular data from the server using jquery's ajax function. And I'm using the .html function to assign the fetched data inside a div with an id of list_forms. How do I animate it? I'm trying $('#list_forms').html(data).show('slow'); but its开发者_如何学JAVA not working.

$.ajax({
    type: "POST",
    url: "item_lister.php",
    data: "category=" +  action,
    success: function(data){
        $('#list_forms').html(data);
    }
});


Try this

$.ajax({
   type: "POST",
   url: "item_lister.php",
   data: "category=" +  action,
   success: function(data){
       $('#list_forms')
         .hide()
         .html(data)
         .fadeIn();
   }

});

0

精彩评论

暂无评论...
验证码 换一张
取 消