ethanselzer / react-image-magnify

A responsive image zoom component designed for shopping sites.
https://ethanselzer.github.io/react-image-magnify
MIT License
645 stars 160 forks source link

Cannot change the zoom position left-to-right #165

Open alizada-hadi opened 1 year ago

alizada-hadi commented 1 year ago

I want to change the zoom image position from right to left, but I can't. It just accepts the beside and over value as position.

raf723 commented 1 year ago

Use the enlargedImageContainerStyle to achieve this:

<ReactImageMagnify
  {...{
    smallImage: {
      width: 500,
      height: 500,
      src: imageSrc
    },
    largeImage: {
      width: 1200,
      height: 1800,
      src: imageSrc
    },
    enlargedImageContainerStyle: {
      left: 'unset',
      right: '100%',
      marginLeft: 'unset',
      marginRight: '10px'
    }
  }}
/>