开发者

jQuery.animate - animating really really fast

jQuery('.slide').css('opacity','1').animate({

            opacity: 0
        }, {
            duration: 9999,
            complete: function() {
                this.moveSlideAcross(); // animates a slide across the screen
            }
        });

I've set the duration for 9999 and it's animating really really fast. Any id开发者_StackOverflow社区eas how to slow it down?


remove the second set of braces.

jQuery('.slide').css('opacity','1').animate(
    {
        opacity: 0
    },
    9999,
    function() {
        this.moveSlideAcross(); // animates a slide across the screen
    }
);

edit: my apologies as this does not work. i dont think i understand jquery as well as i should. ill look into it more and fix this answer when i better understand.

edit2: actually this does work :) cheers!


I think there is a syntax error. Try this:

$('.slide').css('opacity','1').animate(
  {
    opacity: 0,
    left: 0, //your left pos
    top: 0 // your top pos
  },
  9999,
  function() {
    //completion code
  }
);

Use top/left in the same declaration as where opacity is to make sure you're not leaving the scope of the animation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜