views:

52

answers:

1

Hello everyone.

$('#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.

+7  A: 

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);
    });
});
Anurag