2011-05-21 155 views
0

我一直在尝试新的webkit CSS3动画技术。我做了一个应该可以工作的可折叠面板,但奇怪的是跳起来并且静止不动。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/

回答

0

我觉得你的问题是,你有72px的高度在一类,而在另一个100%。改为例如400px在第二课,它工作正常。

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

K