开发者

JQuery coding problem

I'm really new to Jquery and I know my code below is wrong. Can someone help me fix it so it works properly?

Here is my code.

$(document).ready(function() {
    setTimeout(function() {
    $('a.delete'开发者_开发问答).click(function(){
    $("div.delete-banner").delay(6000).fadeOut();
      // prevent default action
      return false;
    },5000);
    });
});


You have passed the second argument for setTimeout() to the click() function instead. It can help to properly indent your code so you can spot things like this easier:

$(document).ready(function() {
    setTimeout(function() {
        $('a.delete').click(function(){
            $("div.delete-banner").delay(6000).fadeOut();
            // prevent default action
            return false;
        });     // <- Moved from here
    }, 5000);   // <- To here
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜