Basically, the reverse of abs. If I have:
if ($this.find(\'.pdxslide-activeSlide\').index() < slideNum - 1) {
slideNum = -slideNum
}
console.log(slideNu
If you don't feel like using Math.Abs * -1 you can you this simple if statement :P
if (x > 0) {
x = -x;
}
Of course you could make this a function like this
function makeNegative(number) {
if (number > 0) {
number = -number;
}
}
makeNegative(-3) => -3 makeNegative(5) => -5
Hope this helps! Math.abs will likely work for you but if it doesn't this little