I'm trying to change the css property visibility of a div to visiblewith a jQuery .fadeIn()transition.
Here is my code :
$('a').click(function() {
$('#test').fadeIn('slow', function() {
$(this).css('visibility','visible');
});
});
and the fiddle : http://jsfiddle.net/np6r7/
The fadeIn() Method in jQuery is used to change the opacity of selected elements from hidden to visible. The hidden elements will not be display. Syntax: $(selector).fadeIn( speed, easing, callback )
The . fadeIn() method animates the opacity of the matched elements.
You cannot animate visibility. fadein is keyed off display:none;, so that should be #test's initial state via CSS. If you need to keep the layout, you can try wrapping test in a div that specifies the height and/or width you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With