-5
I need to put one display: nome
to block the class soon, but, the way I did, it is not working. I managed to put a opacity:0
but the display didn’t pick up.
$(document).ready(function(){
$(".logo").animate({display: 'nome'}, 0);
});
-5
I need to put one display: nome
to block the class soon, but, the way I did, it is not working. I managed to put a opacity:0
but the display didn’t pick up.
$(document).ready(function(){
$(".logo").animate({display: 'nome'}, 0);
});
9
The error is typing and usage.
Replace with:
<script>
$(document).ready(function() {
$('.logo').css('display', 'none');
});
</script>
The method jQuery.fn.animate
does not work for the property display
because it does not exist in the step
. And you put "name" in the mail of none
.
You can create a transition for the element to disappear using jQuery.fn.fadeOut
in this way:
$('.logo').fadeOut(400);
400 being the duration of the effect.
To make it appear just use jQuery.fn.fadeIn
likewise.
I believe that already resolves.
OK got it perfectly, but how do I use a Duration there ? that’s kind of the Transition if you know what I mean
When filling Duration you need an animation that makes the transition effect and at the end give None display, you can check it manually, but jQuery has some functions ready. You can use in this case $('.logo').fadeOut(400);
this function makes disappear and 400 is the duration (To appear use "fadein").
I got vlw diego =D
@brasofilo will do it, thank you.
6
You cannot animate the display property. Before changing to display none
(that you wrote wrong), you must animate another property whatever makes the element disappear:
width
or height
: animate to 0;
opacity
: animate until full transparency (note that this will cause an undesirable effect as the space will continue occupied during the animation)
Then after these animations, you can set the None display.
Example:
$('.logo').animate({
width: 0
},
{
duration: 5000,
complete: function(){
$('.logo').hide();
}
});
I got it Miguel =D
Browser other questions tagged jquery
You are not signed in. Login or sign up in order to post.
'nome' != 'none'
– bfavaretto