Reputation: 41684
I have the following code but the fadeIn and fadeOut is too fast, I can barely see it.why is that?
$('#post_code_error').html('You Post Code is Out of Range').addClass('post_code_error').show().fadeIn('10000');
<div id="post_code_error"></div>
div#post_code_error {
display:none;
position:absolute;
top:300px;
right:100px;
}
.post_code_error {
width:100px;
height:10px;
border:1px solid #F00;
background-color: #FFC;
color:#F60;
}
Upvotes: 1
Views: 707
Reputation: 8966
Remove the .show()
call. This makes it appear instantly before the fadeIn()
method is called. Also use an integer
for the fadeIn
method execution time, as opposed to a string
.
Upvotes: 1
Reputation: 110768
Your value for the amount of time it should take should not be a string:
$('#post_code_error').html('You Post Code is Out of Range').addClass('post_code_error').show().fadeIn(10000);
Upvotes: 4