答案 0 :(得分:5)
将position:relative;
添加到您的css:
.anim_queue_example1 a
{
margin: 15px;
width: 50%;
height: 25px;
display: -webkit-box;
display: -moz-box;
display: box;
-webkit-box-align: center;
-moz-box-align: center;
box-align: center;
text-decoration: none;
font-size: 15px;
font-weight: 700;
background: #333;
color: #fff;
position:relative;
}
答案 1 :(得分:2)
这样可行。
$(document).ready(function() {
$('ul.anim_queue_example1 a')
.hover(function() {
$(this).animate({
opacity: 0.25,
left: '+=20',
height: 'toggle'
}, 5000, function() {
// Animation complete.
});
}, function() {
$(this).animate({
opacity: 0.25,
left: '+=0',
height: 'toggle'
}, 5000, function() {
// Animation complete.
});
});
});
在此处查看工作示例http://jsfiddle.net/pJMva/23/