Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/450.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 语法错误-逻辑if语句_Javascript_Jquery_If Statement_Logical Operators - Fatal编程技术网

Javascript 语法错误-逻辑if语句

Javascript 语法错误-逻辑if语句,javascript,jquery,if-statement,logical-operators,Javascript,Jquery,If Statement,Logical Operators,我只是在逻辑运算符中使用If语句。我不知道它为什么显示sytax错误 var divWidth = $("#columnwraper").width(); //getting the width of the div $("#right-button").click(function() { if (cursor != totalWidth && totalWidth !< divWidth) { $box2.animate({

我只是在逻辑运算符中使用If语句。我不知道它为什么显示sytax错误

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]合成错误:条件后缺失

我做错了什么?

这样说:

if (cursor != totalWidth && !(totalWidth < divWidth))
! 这样说:

if (cursor != totalWidth && !(totalWidth < divWidth))
! totalWidth中存在错误!<等宽

应为totalWidth=divWidth

totalWidth中的错误!<等宽


应该是totalWidth=divWidth

对于totalWidth
还有 对于totalWidth
还有!是什么!注意!=是一个接线员。这不是一个组合!和==。你不能简单地组合!与其他运营商合作,即@费利克斯克林注意到了费利克斯。谢谢。不知道为什么投票结束这个问题-这个问题很好,有一个有效的被接受的答案是什么!注意!=是一个接线员。这不是一个组合!和==。你不能简单地组合!与其他运营商合作,即@费利克斯克林注意到了费利克斯。谢谢。不知道为什么投票结束这个问题-这个问题很好,有一个有效的被接受的答案>=。我想是的!不仅仅是打字错误。或>=。我想是的!这不仅仅是一个打字错误。