在不改变页面布局的情况下淡入淡出元素 [英] Fading elements in and out without changing the layout of the page

查看:18
本文介绍了在不改变页面布局的情况下淡入淡出元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 fadeInfadeOut 就是使用 display 属性.但是,这会更改页面的布局.

The normal behavior when using fadeIn and fadeOut is to use the display property. However, this changes the layout of the page.

如何让fadeInfadeOut 不修改页面布局?

How can I make fadeIn and fadeOut not modify the layout of the page?

推荐答案

代替 .fadeIn() 你可以 .animate({opacity:1})
而不是 .fadeOut() 你可以 .animate({opacity:0})

instead of .fadeIn() you can .animate({opacity:1})
and instead of .fadeOut() you can .animate({opacity:0})

这篇关于在不改变页面布局的情况下淡入淡出元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆