Useless setTimeout call (missing quotes around argument?)

前端 未结 5 1937

I have this sniplet of code in jQuery

$element.parent().children().last().hide().show(\'slide\', {direction : \'left\'}, 700, function () {
    $element.delay(20         


        
5条回答
  •  失恋的感觉
    2021-02-12 20:05

    Just for reference if someone stumbles upon this question and is looking for a possible answer. I got the exact same error message as the initial poster because I was mixing up the setTimeout arguments order.

    This:

    setTimeout(25, function(){
        spotlight.intro.find('#intro').ellipsis();  
    });
    

    ... gave me the error message. I changed the function to this:

    setTimeout(function(){
        spotlight.intro.find('#intro').ellipsis();
    }, 25);
    

    And my problem was solved.

提交回复
热议问题