Append an element with fade in effect [jQuery]

后端 未结 4 1020
太阳男子
太阳男子 2020-12-22 18:53
var html = \"
Hello stuff here
\" $(\"#mycontent\").append(html).fadeIn(999);

This doesn\'t seem to work.

4条回答
  •  臣服心动
    2020-12-22 19:10

    since the fadeIn is a transition from hide to show, you'll have to hide the "html" element when you append it and then to show it.

    var html = "
    Hello stuff here
    " $("#mycontent").append(function(){ return html.hide(); }); $('#blah').fadeIn(999);

提交回复
热议问题