0
A
回答
3
自己制作一个很简单。
的主要步骤包括:
- 创建一个div元件,固定于所述顶部,高度零
- 把一个按钮以右上角
- 绑定事件到按钮,当按下时,肘节div的高度。
下面是一个例子:http://codepen.io/SLRXXX/pen/YWVdJZ
$('.button').on('click', function() {
$('.top').toggleClass('active');
});
.top {
position: fixed;
top: 0;
left: 0;
height: 0;
width: 100%;
}
.strip {
height: 0;
background-color: yellow;
transition: height 0.5s;
line-height: 40px;
text-align: center;
overflow: hidden;
}
.top.active .strip{
height: 40px;
}
.button {
position: absolute;
top: 0;
right: 5px;
width: 40px;
height: 40px;
line-height: 40px;
text-align: center;
display: inline-block;
background-color: yellow;
color: #fff;
cursor: pointer;
}
.arrow-down {
transition: transform 0.5s;
}
.top.active .arrow-down{
transform: rotate(180deg)
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<div class="top">
<div class="strip">
some content
</div>
<div class="button">
<i class="glyphicon glyphicon-chevron-down arrow-down"></i>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
+0
完美。我将高度更改为自动,并且它变得快速响应。 .top.active .strip {height:auto; } – LovingRails
相关问题
- 1. 如何刮优惠券网站的优惠券代码(优惠券代码亮起点击按钮)
- 2. Magento创建优惠券
- 3. Chargify API优惠券创建
- 4. 创建优惠券代码
- 5. 通过API创建的优惠券
- 6. Drupal Commerce - 如何以编程方式创建固定优惠券?
- 7. 创建一个随机Magento优惠券
- 8. 通过API创建Magento优惠券
- 9. 如何发送自动邮件(优惠券网站)?
- 10. 以编程方式在WooCommerce中创建多个优惠券
- 11. 优惠券代码
- 12. Magento优惠券getDiscountAmount()?
- 13. 小计减优惠券/ Magento的
- 14. 使用可配置产品的子产品创建优惠券
- 15. 如何在Magento的特定产品或类别上创建优惠券?
- 16. 优惠券代码在电子商务网站验证
- 17. 无法以编程方式创建优惠券代码
- 18. 如何通过优惠券代码获得优惠券折扣金额?
- 19. 如何以编程方式在Recurly中创建和兑换优惠券?
- 20. iPhone的优惠券更新
- 21. Magento的 - 优惠券问题
- 22. 网站:导航栏
- 23. 如何获取外部页面优惠券/优惠券表单以在OpenCart中工作?
- 24. 如何追踪多张优惠券?
- 25. 如何使优惠券代码结账
- 26. 如何在magento中导入优惠券csv文件admin
- 27. 如何在magento中导入优惠券代码csv
- 28. 使用PHP优惠券网站脚本:重定向错误php
- 29. 生成优惠券代码
- 30. 优惠券代码统计
你点击并查看页面源代码? – mlegg