开发者

Animate hidden hyperlink to display:block

开发者 https://www.devze.com 2022-12-27 06:04 出处:网络
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

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


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消