threesixty-slider icon indicating copy to clipboard operation
threesixty-slider copied to clipboard

Reverse rotation/drag direction

Open davidmittelberg opened this issue 10 years ago • 4 comments

Is there a way to reverse the rotation of the image when dragging?

davidmittelberg avatar Apr 15 '15 19:04 davidmittelberg

Can you please explain ?

creativeaura avatar May 14 '15 21:05 creativeaura

I've got the same "problem". In our capturing process we spin the objects clockwise, but 360slider is expecting the images to spin counterclockwise. So a reverse option would be nice to have :+1:

dominiklessel avatar May 21 '15 12:05 dominiklessel

Work for me, on line 476 and 478 threesixty.js, you can replace :

      AppConfig.currentFrame + Math.ceil

with

      AppConfig.currentFrame - Math.ceil

and

      AppConfig.currentFrame + Math.floor

with

      AppConfig.currentFrame - Math.floor

On https://github.com/creativeaura/threesixty-slider/blob/master/src/threesixty.js#L476

      AppConfig.endFrame = AppConfig.currentFrame + Math.ceil((AppConfig.totalFrames - 1) * AppConfig.speedMultiplier * (AppConfig.pointerDistance / base.$el.width()));
      }else{
      AppConfig.endFrame = AppConfig.currentFrame + Math.floor((AppConfig.totalFrames - 1) * AppConfig.speedMultiplier * (AppConfig.pointerDistance / base.$el.width()));
      }

Could be a configuration option (eg : AppConfig.rotationDirection) ?

yvestan avatar Jun 02 '15 07:06 yvestan

You can just reverse se rotation by changing the speedMultiplier in the AppConfig to -7 (default being 7)

brospars avatar Aug 17 '17 16:08 brospars