最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery missing : after property id - Stack Overflow

programmeradmin4浏览0评论

$('#note').click({ $('#trigger').remove();

    $('#info').slideDown(4000, function(){
        $(this).fadeOut(40000);
    });
});

What I'm trying to do here is obvious. Sadly, when I try this piece of code, FireBug throws the following error: missing : after property id.

After trying to debug for some time, I saw that seemingly nothing is wrong. The highlighting shows correctly in my editor (Notepad++), and no previous error was found.

Thank you in advance for any help.

$('#note').click({ $('#trigger').remove();

    $('#info').slideDown(4000, function(){
        $(this).fadeOut(40000);
    });
});

What I'm trying to do here is obvious. Sadly, when I try this piece of code, FireBug throws the following error: missing : after property id.

After trying to debug for some time, I saw that seemingly nothing is wrong. The highlighting shows correctly in my editor (Notepad++), and no previous error was found.

Thank you in advance for any help.

Share Improve this question asked Jul 24, 2010 at 23:14 BenBen 311 silver badge2 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

click expects a function. You are trying to pass it a pseudo object-literal having an invalid syntax.

$('#note').click(function() { // pass a function to "click"
    $('#trigger').remove();

    $('#info').slideDown(4000, function(){
        $(this).fadeOut(40000);
    });
});
发布评论

评论列表(0)

  1. 暂无评论