views:

299

answers:

2

Hi guys,

given a hidden hyperlink (hidden by setting display: inline in a css file), how can I achieve to animate this hyperlink to 'display:block'? Neither show() nor the following code

 .animate({
     display: block
 }, {
     duration: 500
 }

do work!

Anny suggestions? Cheers, cube

A: 

you are using animate with a wrong css property.

just go like

 $('a.link').fadeIn();

here you can find all the info you need to get started with jquery effects

XGreen
Sorry, you are wrong, the use of the fadeIn() effect results in display:inline, that's not what I wanted to achieve. The visible hyperlink has to have display set to "block"!
cube
sorry. then use .css({display : 'block'}); as a call back function for your animatelike$("a.link").fadeIn("slow", function() { $(this).css({'display' : 'block'}) });
XGreen
great, thank you!
cube
the up arrow next to my comment :)
XGreen
Please do put in my score if you got your answer. thank you
XGreen
A: 

The animate method needs something that has more than 2 states. Like another answer suggested, you can use the .fadeIn() / .fadeOut methods. The other choice is to animate the css opacity value.

David