jquery - CSS3 可折叠面板

标签 jquery animation css

我一直在试验新的 webkit CSS3 动画技术。我制作了一个应该可以工作的可折叠面板,但奇怪的是它在跳跃和静止。

CSS

.reveiws .content {
    font-size:12px;
    line-height:18px;
    height:72px;
    overflow:hidden;
    float:left;
    vertical-align:top;
    max-width:560px;
    -webkit-transition: height 800ms;
    -moz-transition: height 800ms;
}
.reveiws .contentfull {
    height:100%;
    -webkit-transition: height 800ms;
    -moz-transition: height 800ms;
}

HTML

<div id="pan<?php the_ID();?>" class="content"><?php the_content();?></div>

    <div class="author" style="text-align:left; padding-right:10px;">

    <a href="#" onclick="$('#pan<?php the_ID();?>').addClass('contentfull'); $(this).hide(); $(this).next().show(); return false">Read More &raquo;</a>
    <a href="#" onclick="$('#pan<?php the_ID();?>').removeClass('contentfull'); $('#pan<?php the_ID();?>').addClass('content'); $(this).hide(); $(this).prev().show(); return false" style="display:none;">&laquo; Close panel</a>

这是一个 FIDDLE http://jsfiddle.net/L6Jwa/1/

最佳答案

我认为你的问题是你在一个类中的高度为 72px 而在另一个类中为 100%。更改为例如二等舱 400 像素,效果很好。

我不确定在这种情况下您是否可以使用 % 单位。

K

关于jquery - CSS3 可折叠面板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6081777/

相关文章:

java - 使用jquery调用web服务

ios - 加载仅在按钮功能后显示的动画(Swift)

javascript - 以前我从谷歌驱动器渲染图像,现在我需要从本地路径渲染它。如何在 Reactjs 中渲染 const 变量中的图像?

javascript - JS 对象文字中的 "This"- 事件回调中的不同含义

javascript - 你如何在Javascript中的对象数组中找到属性的最小值和最大值

javascript - 用 highcharts pie 扫一扫动画

ios - AutoLayout 约束动画从错误的点缩放

HTML 不居中

performance - 很少的 CSS 属性及其解析性能

javascript - 如何解决 "NetworkError: 404 Not Found - http://localhost:50765/Scripts/jquery-1.5.1.min.js"错误