0

我正在为弹出窗口制作动画,以便它们同时淡入和滑入。我想在隐藏后重置隐藏弹出窗口的位置,以便动画每次都相同。

当元素滚动时,弹出窗口向下滑动并淡入。当它滚出时,弹出窗口进一步向下滑动并淡出,然后当它被隐藏时,将自身重置为其初始位置。

这是我的代码:

$('*:has(.rollover)').hover(function(){
  $('.rollover',this).fadeIn('fast').animate({
    'top' : '60px',
  }, {duration: 'fast', queue: false}, function() {});
},function(){
  $('.rollover',this).fadeOut('fast').animate({
    'top' : '70px',
  }, {duration: 'fast', queue: false}, function() {
    console.log("hello");
    $(this).css('top','50px');
  });
});

top问题是没有触发 is reset的最后一行,日志语句也没有。为什么是这样?

4

1 回答 1

0

我的错误是:

, {duration: 'fast', queue: false}, function() {});

当我应该有的时候:

, {duration: 'fast', queue: false, complete : function() {}});
于 2013-05-09T11:59:13.620 回答