Dreamweaver给出一个错误。正确的语法是什么?
第一个之后
.animate({left: '-=980'}, 550,
?
真正的问题是:我只能在这段代码中使用一个“.animate({left: '-=980'}, 550,”...如果我想添加两个(或更多),就会出现错误) .animate 在动画队列中。
顺便说一句:“clicknr”变量和“disabled”CSS 类 - 只是某些内部进程的标志。
$('#fwdShowroom').click(function() {
$button = $(this);
if ( clicknr != 1 ) {
if( !$button.hasClass( 'disabled' ) ) {
$button.addClass( 'disabled' );
clicknr -= 1,
$('#showroom ul')
.animate({left: '-=985'}, 550,
Dreamweaver says: Error on this line .animate({left: '+=5'},200,
function() { $button.removeClass('disabled') });
}
}
});
所需的效果是:“#showroom ul”DIV 平滑地向前移动,然后平滑地向后移动一些像素,以创建良好的物理运动。
最佳答案
您忘记了第一个 animate
调用中的右括号 )
:
.animate({left: '-=985'},550)
关于javascript - jQuery .animate 队列不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4105132/