Positive Number to Negative Number in JavaScript?

Math.abs(num) => Always positive
-Math.abs(num) => Always negative

You do realize however, that for your code

if($this.find('.pdxslide-activeSlide').index() < slideNum-1){ slideNum = -slideNum }
console.log(slideNum)

If the index found is 3 and slideNum is 3,
then 3 < 3-1 => false
so slideNum remains positive??

It looks more like a logic error to me.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)