javascript 使用 jQuery/CSS 缩小/增长动画

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13324537/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 18:26:17  来源:igfitidea点击:

Shrink/Grow animation using jQuery/CSS

javascriptjquerycssanimationjquery-animate

提问by Nyxynyx

How can a grow/shrink animation be done with jQuery and/or CSS? An example that I can think of is thiswhen you click on the Join Nowbutton.

如何使用 jQuery 和/或 CSS 完成增长/缩小动画?我能想到的一个例子是这样,当你点击Join Now按钮。

I looked into animate.cssbut they did not offer such an animation.

我查看了animate.css但他们没有提供这样的动画。

回答by Coby

DEMO— Solution using CSS3's transition-duration(W3Schools) and transform:scale(X,Y);(W3Schools).

演示— 使用 CSS3transition-duration(W3Schools) 和transform:scale(X,Y);(W3Schools) 的解决方案。

Update:

更新:

DEMO— Going a step further, doing more than just changing to opacity:0;by adding display:none;(via jQuery .hide()) at the end of the animation.

演示— 更进一步,不仅仅是通过在动画末尾opacity:0;添加display:none;(通过 jQuery.hide())来更改为。