Animating inline elements with jQuery

前端 未结 6 506
佛祖请我去吃肉
佛祖请我去吃肉 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 09:05

    I don't think what you want to do is possible until display:inline-block is well supported across browsers. For now, I think I would fade the background to red, and then hide the element.

    If display:inline-block was well supported, you could change the style to inline-block, and then animate the width or height, but unfortunately that won't work very well these days. Maybe in 2010 :)

提交回复
热议问题