0

我想wait()在两个函数之间添加一个或延迟。

function(imageID)
    {
        //alert("i main slider called ");

        if(en==1)
        {
            var selected=$('#' + sel);
            $(selected).animate({"left": "+=30px","opacity": "0.99"},"slow");
            $(selected).animate({"height":"354px","width":"295px"},30);
            $(selected).css("-webkit-transform-style","preserve-3d");
            $(selected).css("-webkit-transition","all 1.0s linear");
            $(selected).css("transform-style","preserve-3d");
            $(selected).css("transition","all 1.0s linear");
            $(selected).css("-webkit-transform","rotateY(0deg)");
            $(selected).css("transform","rotateY(0deg)");
            en=0;
        }

        if(my.circular)
        {
            /* Trigger left jumppoint */
            if(imageID+1 === my.imageFocusMax)
            {
                /* Set jump target to the same cloned image on the right */
                clonedImageID = my.max - my.imageFocusMax;
                jumpTarget = -clonedImageID * my.xStep;

                /* Set the imageID to the last image */
                imageID = clonedImageID-1 ;
            }

在我的函数中,我想在 if 语句之后添加一个 delar。我怎样才能做到这一点?我已经尝试添加delay(),但它不起作用。我应该使用什么?

4

1 回答 1

3

使用setTimeout函数。这样你就可以告诉浏览器在做某事之前等待。

于 2013-05-08T12:54:41.147 回答