Animating inline elements with jQuery

前端 未结 6 504
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 08:40

I am trying to show and hide an inline element (eg a span) using jQuery.

If I just use toggle(), it works as expected but if I use toggle(\"slow\") to give it an ani

6条回答
  •  离开以前
    2020-12-14 08:59

    As other answers have shown, fading is possible. However, I don't think "smooth sliding" will be. Simply put, a specific property of the element has to be animated. An inline span like you mention has no specific height or width, though it does have an opacity.

提交回复
热议问题