1

論理演算子で If ステートメントを使用しているだけです。構文エラーが表示される理由がわかりません。

var divWidth = $("#columnwraper").width(); //getting the width of the div   
$("#right-button").click(function() {
    if (cursor != totalWidth && totalWidth !< divWidth) {
        $box2.animate({
            marginLeft : "-=300"
        }, "fast");

        cursor += 100;
    }
    // console.log(colwidth.width());
});

それを示している

[15:18:24.050] SyntaxError: 条件の後に ) がありません。

ここで何が間違っていますか?

4

3 に答える 3

8

このように言えます:

if (cursor != totalWidth && !(totalWidth < divWidth))

!<演算子ではありません。

于 2013-06-27T09:56:10.090 に答える
2

エラーtotalWidth !< divWidth

または_totalWidth < divWidth totalWidth >= divWidth

于 2013-06-27T09:57:02.917 に答える