i am working on a web app in which after submit it calls a ajax page.Now if email is already present then it will throw alert.For this purpose I am doing bootstrap alert.But its working for the first time.Please see this bootply, When you press the add button then alert displays only first time.
Asked
Active
Viewed 1,406 times
2 Answers
2
Well, duh, you're fading the alert out, so next time it shows it's invisible :
$(".alert").delay(200).addClass("in").fadeOut(3500);
// ^^^ that's a fadeOut
change it to :
$(".alert").delay(200).addClass("in").fadeOut(3500, function() {
$(this).removeClass('in').show();
});

adeneo
- 312,895
- 29
- 395
- 388
1
.fadeOut()
implicitly sets display: none;
, thus you'll have to revert that, for example by calling .show()
.
$(".alert").show().delay(200).addClass("in").fadeOut(3500);

Kiruse
- 1,703
- 1
- 12
- 23
-
well where show() defined I didnt not get show() here http://getbootstrap.com/javascript/ – SpringLearner Nov 17 '13 at 10:20
-
I was searching for show() http://getbootstrap.com/javascript/ but could not find so I asked.Thanks – SpringLearner Nov 17 '13 at 10:22