JQuery数学-无法100%确定如何管理我需要的内容

JQuery数学-无法100%确定如何管理我需要的内容,jquery,Jquery,不知道是否有人能帮我,我知道我想要实现什么,但却在努力让它发挥作用 if (left_indent == ((imageReelWidth * 2) - ((imageReelWidth * 2) - imageWidth)) { alert ("boo"); } 我知道上面说的不对,我需要的是: 我有两个变量: imageReelWidth的值为800 imageWidth的值为200 当一个名为left_indent的变量达到-600时,我需要触发一个警报 希望这能解释得更清

不知道是否有人能帮我,我知道我想要实现什么,但却在努力让它发挥作用

if (left_indent == ((imageReelWidth * 2) - ((imageReelWidth * 2) - imageWidth)) {
 alert ("boo");      
}
我知道上面说的不对,我需要的是:

我有两个变量: imageReelWidth的值为800 imageWidth的值为200

当一个名为left_indent的变量达到-600时,我需要触发一个警报

希望这能解释得更清楚一点

这是负600


对不起,只是我的数学不好

如果(左缩进==(imageReelWidth-(imageReelWidth*2-imageWidth))){ 警报(“boo”);}

所以你想

if (left_indent == (imageWidth - imageReelWidth)) {
    alert ("boo");      
}

((imageReelWidth*2)-(imageReelWidth*2)-imageWidth)
将等于
-200
,因此它不会到达您的
警报
。您也在努力传达您想要实现的目标。这里的问题是什么?您需要包括更多详细信息,例如这些数字来自何处、它们代表什么、此代码应该运行的时间等。抱歉,请稍微解释一下R