JavaScript error (Uncaught SyntaxError: Unexpected end of input)

后端 未结 11 2131
天命终不由人
天命终不由人 2020-11-27 10:30

I have some JavaScript code that works in FireFox but not in Chrome or IE.

In the Chrome JS Console I get the follow error:

\"Uncaught Synta

11条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 10:53

    Add a second });.

    When properly indented, your code reads

    $(function() {
        $("#mewlyDiagnosed").hover(function() {
            $("#mewlyDiagnosed").animate({'height': '237px', 'top': "-75px"});
        }, function() {
            $("#mewlyDiagnosed").animate({'height': '162px', 'top': "0px"});
        });
    MISSING!
    

    You never closed the outer $(function() {.

提交回复
热议问题