I have the following code that clones a div and it's content on clicking a button. The clone part works but when it outputs the cloned div I want it to slide down.
This is what I've tried but the cloned div just appears rather than sliding down. Where am I going wrong?
$(".add-prod-group").on('click', function(){
var ele = $(this).next().next().next('.group-add-prod').clone(true);
$(this).next().next().next('.group-add-prod').after(ele).slideDown();
});
HTML:
<a href="#" class="add-prod-group">+</a>
<p class="text-center">Add products to your order</p>
<hr />
<div class="group-add-prod">
<p>contents</p>
</div>
https://jsfiddle.net/dx29Lfo8/
question from:
https://stackoverflow.com/questions/65846400/slide-cloned-element-down-when-it-appears 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…