标签被显示时,.box {
background-color: blue;
overflow: hidden;
transition: all 1s;
}const autoH = $('.box').height();
let h = 0;
$('.box').height(0);
$('.button').click(function() {
$('.box').height(h ^= autoH);
});
如何解决 CSS 过渡动画中高度撑起的意外情况?
css过渡动画与高度撑起的处理
在网页设计中,当使用 css 过渡动画时,有时可能会遇到元素在显示时高度瞬间撑起的意外情况。以下就遇到的这个问题进行分析和解决。
js bin 链接:https://jsbin.com/hofoconeru/...
从问题图片中可以看到,
