Javascript 语法错误-逻辑if语句
我只是在逻辑运算符中使用If语句。我不知道它为什么显示sytax错误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({
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应该是totalWidth
还有 对于totalWidth
还有!是什么!注意!=是一个接线员。这不是一个组合!和==。你不能简单地组合!与其他运营商合作,即@费利克斯克林注意到了费利克斯。谢谢。不知道为什么投票结束这个问题-这个问题很好,有一个有效的被接受的答案是什么!注意!=是一个接线员。这不是一个组合!和==。你不能简单地组合!与其他运营商合作,即@费利克斯克林注意到了费利克斯。谢谢。不知道为什么投票结束这个问题-这个问题很好,有一个有效的被接受的答案>=。我想是的!不仅仅是打字错误。或>=。我想是的!这不仅仅是一个打字错误。