使用 jquery 的 .before 后如何淡入元素?
jQuery
$('.button').on("click", function(event){
var html = '';
html = '<div class="row new">Test</div>';
$('.content .row:first').before(html);
});
HTML
<a class="button">Insert me and fade me</a>
<div class="content">
<div class="row"></div>
<div class="row"></div>
<div class="row"></div>
</div>
最佳答案
$(function() {
$('.button').on("click", function(event){
var html = '';
html = '<div class="row new">Test</div>';
$('.content .row:first').before($(html).fadeIn());
});
});
关于jquery - 带有 .before Jquery 的 FadeIn 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11090854/