jquery - CSS ease-in ease-out 不适用于 max-height 0 和 max-height auto
问题描述
我正在尝试在我的一个 wordpress 页面上应用缓入和缓出,如下所示:
.section1 {
max-height: 0px;
overflow: hidden;
transition: max-height 0.15s ease-out;
}
.section1.show {
max-height: auto;
overflow: visible;
transition: max-height 0.25s ease-in;
}
然而,这不起作用,它不是缓入和缓出......我做错了什么?
我像这样调整了我的代码:
.vc_section {
max-height: 0px;
overflow: hidden;
transition: max-height 1.15s ease-out !important;
}
.section1.show {
max-height: 500px;
overflow: visible;
transition: max-height 1.25s ease-in !important;
}
缓入有效,缓出无效。当用户单击一个按钮时,我试图让缓动工作:
$('.architectural-films').bind('click', function(){
if ($(".section1").hasClass("show")) {
$('.section1').removeClass('show');
}
else
{
$('.section1').addClass('show');
}
return false;
});
解决方案
推荐阅读
- scala - Maven 没有要编译的资源
- tensorflow - 尝试重新启动运行时时,GPU 挂起初始化
- python-3.x - 队列行为异常
- python - Python:从文件中读取特定行并替换这些行上的特定字符并保存文件
- shell - 安装 gem 后找不到命令
- java - Spring中的服务门面
- c++ - C ++如何告诉开发人员实现某事。设计模板时(如 Java 接口)
- reactjs - 如何在 onClick 函数中将繁忙的光标添加到 reactstrap 模态按钮。该功能是一个承诺
- node.js - 如何在 express/node.js 应用程序中使用 mailgun/mailchimp/etc 发送电子邮件
- jquery - 使用 CSS 或 Jquery 在 div 中删除时间文本的最佳方法是什么