开发者

SyntaxError: Unexpected token

$(document).ready(function() {
    $('div.view-kettha-links div.view-content').hoverscroll
    ({
        width: 225,
        height开发者_如何学运维: 100,
        vertical: true,
        arrows: true,
        arrowsOpacity: 0.7; --> chrome detect as SyntaxError: Unexpected token
    });
});

chrome detect as SyntaxError: Unexpected token but still working,in firefox the function is fine but in IE the function didn't works at all,needs help please.


arrowsOpacity: 0.7;
// remove this....^

Assuming it is in your source code and wasn't added by Chrome as part of its error message, remove the semicolon.


Get rid of the semicolon on that line.


You are getting an error because an JavaScript object is separated by commas (,) not semicolons (;). JavaScript objects must not contains semicolons, using semicolons in objects throws an error. So that's why, there is no need for the last semicolon from the line arrowsOpacity: 0.7;, just remove the semicolon and your code will start working

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜