我想加载一个扩展div内的html文档,我想动画展开。 因为它现在我只能设置一个高度,它动画,然后只显示其余。动画文件的高度jQuery
所以我想我想要它加载的内容,然后动画,基本上它说300px它应该是我的HTML文档的高度(这是不同的,因为它是我的投资组合中的不同项目)。
box_project2 HTML在单独的html文档中,应该定义动画高度。
链接到我的网站,在此可以通过点击某些顶级项目来查看相应的问题。 http://richardhedberg.com/portfolionew/index.html#
$('.thumbs2').click(function() {
var idStr = ("project/" + $(this).attr('id'));
var newHeight = 0;
$('#show2').animate({ height: '300px', opacity: 0 }, function() {
$('#workp').fadeIn('fast');
$.scrollTo('#gohere', 300);
$('#show2').load(idStr, function() {
newHeight = $('#box_project2').outerHeight();
$(this).animate({ height: newHeight }, 300, function() {
$('#show2').delay(200).animate({ opacity: 1 }, 800);
$('#close2').css({ 'display': 'block', 'height': '25px' });
});
});
});
});
<div id="close2">
</div>
<div id="show2">
<div id="box_project2">
</div>
</div>
.workp {
background:#fff;
position:relative;
z-index:999;
margin-bottom:30px;
}
#close2 {
position:absolute;
width:25px;
height:24px;
background:url(images/graphics/CloseIcon.png);
right:0px;
top:0px;
z-index: 9999;
display: none;
margin-left:-30px;
}
#show2 {
display: block;
height: 0px;
opacity: 1;
margin-left:-30px;
clear:both;
}
#box_project2 {
background:#fff;
text-align: left;
clear:both;
height:100%;
}
我觉得你的动画,而它的不透明度为0。我不完全跟随,但如果你设置了在jsfiddle.net上的一个例子,它会更好地表达你的问题。 :) –
http://richardhedberg.com/portfolionew/index.html#如果你想你可以看看我的网站。 –