In principle, the reverse side of abs. If I have:
if($this.find('.pdxslide-activeSlide').index() < slideNum-1){ slideNum = -slideNum } console.log(slideNum)
No matter which console ALWAYS returns a positive number. How to fix it?
If I do this:
if($this.find('.pdxslide-activeSlide').index() < slideNum-1){ _selector.animate({left:(-slideNum*sizes.images.width)+'px'},750,'InOutPDX') } else{ _selector.animate({left:(slideNum*sizes.images.width)+'px'},750,'InOutPDX') }
it works, but itβs NOT βDRYβ and just stupid to have the whole block of JUST code for -
javascript jquery math
Oscar Godson Apr 6 '11 at 23:24 2011-04-06 23:24
source share