dixonandmoe / rellax

Lightweight, vanilla javascript parallax library
https://dixonandmoe.com/rellax/
MIT License
7.04k stars 880 forks source link

Update rellax.js #242

Closed cvillalobos closed 2 years ago

cvillalobos commented 2 years ago

Given that the custom wrapper is not precisely working and some other have reported related issues I am adding here a new property switch called 'leadByViewPort' to manage if the animation should only happen when the element is within the ViewPort area.

The editor has automatically formatted/indexed a few lines throughout the file. However, main changes directly related to the new attribute added are the following:

  1. Line 93: leadByViewPort: false,
  2. Line 400: A new function was added to check if the element is within the ViewPort.
  3. Line 419: A new conditional added in the beginning of the function. if ((!self.options.leadByViewPort) || (self.options.leadByViewPort && $('#parallax-wrapper').isInViewport())) {
cvillalobos commented 2 years ago

@moeamaya, will you please take a look a the PR proposed? Thanks.

moeamaya commented 2 years ago

@cvillalobos Do you mind making a new PR without the formatting changes?

cvillalobos commented 2 years ago

@moeamaya, Ok yes, I'll try to send it today. Thanks for taking the time to review this. I'll make sure to notify you when the new PR is in place.

cvillalobos commented 2 years ago

Closing PR as it has included some inconvenient formatting changes.