更新时间:2022-11-04 12:42:54
你可以使用&&
运算符 - 第二个操作数表达式只有在第一个是true
you can use &&
operator - second operand expression is executed only if first is true
direction == "right" && slideOffset += $(".range-slide").width()
在我看来 if(conditon)表达式
比 condition&&表达式