Reputation: 1522
i create simple form using jquery(ajax) and when user submit form the success message will appear slideDown()
and delay for 6 second after that will slideUp()
but when delay() is active i cannot close this box .
$("#show").click(function () {
//ajax will submit form
//$.ajax({
//type: form34.attr("method"),
//url: form34.attr("action"),
//data: form34.serialize(),
//success: function (data) { ...
//when success run this
$(".message_div").addClass("message_success").slideDown().delay(6000).slideUp();
});
$(".close").click(function () {
$(".message_div").slideUp();
});
Here my jsfiddle
Upvotes: 1
Views: 120
Reputation: 2012
this code works for me.
$(".close").click(function () {
$(".message_div").stop().slideUp();
});
Upvotes: 5