CSS3 如何让height:auto实现transition过渡效果
来源:互联网 发布:js 对象添加属性和值 编辑:程序博客网 时间:2024/06/04 18:31
代码如下
<body><script typet="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script><style type="text/css">.oh{overflow:hidden;}.box{max-height:30px;transition: max-height 1s;-moz-transition: max-height 1s;/* Firefox 4 */-webkit-transition: max-height 1s;/* Safari 和 Chrome */-o-transition: max-height 1s;/* Opera */background:#ccc;}/* 关键在于指定一个大于元素在height:auto 时的高度的值,让元素过渡到一个达不到的height值,这样就模拟了height:auto过渡的效果注意max-height不可设置太大,否则效果不明显*/.box-h{max-height:120px;}</style><script type="text/javascript">function boxClick(){$(".box").toggleClass("box-h");}</script><div class="box oh" onclick="boxClick()"><div style="padding:5px 0px;">效果</div><div style="padding:5px 0px;">效果</div><div style="padding:5px 0px;">效果</div></div></body>
阅读全文
0 0
- CSS3 如何让height:auto实现transition过渡效果
- CSS3实现过渡效果 (transition)
- css3的transition 过渡效果
- CSS3 过渡效果transition
- height为auto,css3过渡动画问题
- CSS3 transition 属性过渡效果 详解
- transition属性——css3过渡效果
- 用css3的transition实现过渡动画
- display:none无transition动画过渡;height:auto的transition动画;
- CSS3 过渡之transition
- CSS3之过渡Transition
- CSS3之过渡Transition
- CSS3----过渡transition
- CSS3之过渡Transition
- CSS3之过渡Transition
- css3 transition(过渡)
- css3的过渡transition
- css3过渡动画transition
- MySQL的or/in/union与索引优化
- 常用激活函数的总结与比较
- 职责链模式--解决不了的事往上传
- 游戏机器人
- Windows Server启用防火墙并开放80端口
- CSS3 如何让height:auto实现transition过渡效果
- HDU 6048 Puzzle(机智)
- 算法训练 连续正整数的和
- android应用开发-从设计到实现 4-4版本管理
- 利用Nginx加GeoIP MaxMind数据库获取用户的地理位置
- web应用路径问题
- 线性筛及其应用
- Axis2 提供SOA服务(一)
- 《异类》读书笔记