parallax icon indicating copy to clipboard operation
parallax copied to clipboard

Horizontal positioning of the parallax image

Open petertenhoor opened this issue 6 years ago • 0 comments

Hi there,

I use the parallax-scroll library like this:

new Parallax('.section-site-header-image', {
                offsetYBounds: 50,
                intensity:     75,
                center:        0.5,
                safeHeight:    0.15
            }).init()

The effect looks nice and works like a charm. The only downside of this library is that the horizontal positioning of the image is also controlled.

I use object-position together with object-fit: cover to make the positioning of the image configurable from my CMS. The "left" css property which is set by this library kind of overrules that.

I understand that the "top" css property should change when creating a parallax effect, but why is the horizontal positioning changed? Could the horizontal alignment of the image perhaps be added to the configuration?

petertenhoor avatar Mar 28 '18 11:03 petertenhoor