html - 导航栏中的扩展效果
问题描述
我正在尝试使用 angular 在我的导航栏中制作扩展效果。
当我点击“mostrar informações”时,我需要内容必须上升。
问题是我的页脚的上半部分没有跟随效果。
我尝试类似:
<footer class="page-footer font-small footer-fundo-cinza">
<div class="container">
<div class="row pt-3">
<div class="col-md-4">
<img src="../../../assets/estilomotocar-rodape.png" class="img-responsive img-fluid">
</div>
</div>
</div>
<div [@fadeInUpDown]="mostrar_informacoes" [@statusDisplay]="mostrar_informacoes" class="row">
<div class="container">
<div class="row">
<div class="col-md-12">
<hr>
</div>
</div>
</div>
</footer>
我的动画:
export const statusDisplay =
trigger('statusDisplay', [
state('aberto', style({ display: 'block' })),
state('fechado', style({ display: 'none' })),
transition('fechado => aberto', animate('0ms ease')),
transition('aberto => fechado', animate('0ms 200ms ease'))
])
export const fadeInUpDown =
trigger('fadeInUpDown', [
state('fechado', style({
transform: 'translate3d(0,100%,0)'
})),
state('aberto', style({
transform: 'translate3d(0,0,0)'
})),
transition('fechado <=> aberto', animate('400ms ease'))
])
如果我将动画直接放在页脚中,效果会起作用,但 translate3d 会使我的导航跳出页面,进行滚动。
我的 CSS:
footer{
position: absolute;
bottom: 0;
width: 100%;
}
解决方案
您的代码不足以评估您的问题。通常在 Angular 和任何其他网络语言中,您需要很好地解释您的 css。在这种情况下,我会提出一个包装元素:
<div class="wrapper">
<div class="ride-up">
<div class="ride-up-element"> Some text here </div>
</div>
</div
然后是 CSS:
.wrapper {
display : flex ;
flex-direction : row/column ;
width : you choose it ;
height : as well :
other-options : also you choose;
}
.ride-up {
width : you choose it ;
height : as well :
}
.ride-up:hover {
some css goes here ....
}
.ride-up-element {
some other css goes here....
}
推荐阅读
- python - 如何在 Selenium 中设置执行测试的顺序
- python - 迭代数据帧的第 n 行
- tensorflow - 在 Tensorflows 现有 Estimator 中使用文本作为特征列
- sandbox - Coinbase Pro Sandbox:如何存入测试资金?
- sql-server - SQL 用于通过连字符拆分字符串,然后为每个长度为 3 个或更多字符的块生成所有后缀?
- php - 从mysql数据库中获取多个图像
- python - python中的ODE事件位置
- php - 从 WooCommerce 管理员设置中删除特定选项卡
- java - 如何使用 Files.walk 获取文件夹名称和文件名
- asp.net-core - ASP.NET Core 3.1 在类库中获取连接字符串