Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在创建 DOM 元素、将其附加到另一个元素并使其淡入到位时遇到问题。
这似乎不起作用:
$('<div/>').html('hello').appendTo('#parentDiv').fadeIn();
谁能让我走上正轨
尝试:
$("<div>hello</div>").hide().appendTo("#parentDiv").fadeIn();
或者设置显示无而不是隐藏()。
你有没有尝试过
$('<div/>').html('hello').appendTo('#parentDiv').hide().fadeIn();