0
Slide right to left?可折叠/滑动“托盘”(DIV)
http://www.learningjquery.com/2009/02/slide-elements-in-different-directions
我一直在上面之间跳转试图让我的“托盘”的工作无济于事。部分问题是我不希望其中一个div完全消失。我想要一个“托盘”,一个长矩形,点击后会滑出包含名称的div。现在我把它设置为反向,但我无法弄清楚如何让扩展为默认隐藏的div(*我也不明白为什么它们是不同的颜色,但具有相同的CSS)。
HTML:
<div class ="collapsedTray">
<div class="expandTray">
Joey Joe Joe Jr.</br>
Tommy Thompson Thomas III</br>
Stephen Stephenson </br>
Cool Mo Dee Tomahawk Fire Marshall Bill</br>
</div>
CSS:
.collapsedTray {
width:10px;
height: 500px;
background:grey;
opacity:0.5;
position: absolute;
left:0;
}
.expandTray {
white-space: nowrap;
height: 500px;
background:grey;
opacity:0.5;
position: absolute;
left:0;
padding:8px;
}
Y:
$('.collapsedTray').click(function(){
var $lefty = $('.expandTray');
$lefty.animate({
left: parseInt($lefty.css('left'),10) == 0 ?
-$lefty.outerWidth() :
0
});
});
完美。谢谢。 – Lorenzo 2013-04-03 19:02:06