我的身材多了一点空间



我在这里遇到了一个问题,我创建了一个比例为10/1的图形,它应该与我的img(实际大小为4000*/400*因此比例为10/1)的空间完全相同,但我有一个额外的空间跳出来。

你知道它是从哪里来的吗?

下面是我的代码:http://jsfiddle.net/2drYk/21/
<figure class="container">                  
    <img class="content" src="http://img7.imageshack.us/img7/6766/sampes.jpg" alt="sample" />
</figure>
* 
{
margin:0; 
padding:0; 
border:0
}
.container
{
    width:100%;
    background:black;
    overflow:hidden;    
}
.content
{
    width:100%
}

var $cont = $('.container .content'),
    init_size = $cont.width()*0.1,
    c =0,
    s = [400,init_size];
$cont.height( init_size );
$cont.click(function(){   
  $(this).stop().animate({height: s[c++%2] });
});

编辑:似乎这个问题来自于我在jquery中调用2类的事实,但我仍然不知道为什么,比例仍然相同。

默认情况下,图像是内联显示的,并且每个行高为字符下降符留下空间。

http://jsfiddle.net/2drYk/22/

.content {
    display: block;
}

最新更新