简体   繁体   English

jquery.animate({top: '+=200px}) 不工作

[英]jquery .animate({top: '+=200px}) dont work

I'm having a problem with animate function - my html looks like:我在使用动画 function 时遇到问题 - 我的 html 看起来像:

<body>

<div id="blubloc">

<div id="bluhead1">
</div>
<div id="bluhead2">
</div>
<div id="bluhead3">
</div>

</div>


<div id="whitebloc">

<div id="orangediv">
</div>

<div id="rnd">
<img src="img/logo.gif" alt="ROUNDSHOT" />
<a href="" class="button">klik!</a>
</div> 

</div>

blubloc is in front of whitebloc, using z-index. blubloc 在 whitebloc 前面,使用 z-index。 I'm trying to animate whitebloc sliding down, showing more infrmation - I'm using我正在尝试为 whitebloc 向下滑动设置动画,以显示更多信息 - 我正在使用

$('.button').click(function(){
$('#whitebloc').animate({top: '+=200px'});

});

whitebloc is positioned absolute, and divs inside are positioned relative. whitebloc 是绝对定位的,内部的 div 是相对定位的。 Animation is not working at all... Animation 根本不工作...

This fiddle is working for me:这个小提琴对我有用:

http://jsfiddle.net/Christophe/2bQBA/ http://jsfiddle.net/Christophe/2bQBA/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM