Response title
This is preview!
Can
you please take a look at this
demo and let me know why I am not able to add the .slideDown()
function
to the process of entering a dynamic div after the parent of selected element?
$(function () {
$("button").on("click", function () {
$(".err").hide();
var elem = $(this);
elem.parent().after('<div class="alert alert-danger err" role="alert">Thanks For Adding</div>').slideDown("slow");
});
});
@import url("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css");
body {
padding:50px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<div class="well well-sm box">
<button class="btn btn-default btn-block" type="submit">Add Box</button>
</div>
<div class="well well-sm box">
<button class="btn btn-default btn-block" type="submit">Add Box</button>
</div>
<div class="well well-sm box">
<button class="btn btn-default btn-block" type="submit">Add Box</button>
</div>
<div class="well well-sm box">
<button class="btn btn-default btn-block" type="submit">Add Box</button>
</div>
<div class="well well-sm box">
<button class="btn btn-default btn-block" type="submit">Add Box</button>
</div>
© 2013 jQuery Foundation
Sponsored by and others.