我只是在邏輯運算符中使用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] SyntaxError: missing) after condition.
我在做什麼錯在這裏?
什麼是'!<'運算符?爲什麼不用'> ='來代替? –
什麼是$ box2 ..? – iJade
注意'!='是*一個*運算符。它不是'!'和'=='的組合。您不能簡單地將'!'與其他操作符(即'!<'無效)結合使用。 –