Closed omiroshnichenko closed 4 years ago
@omiroshnichenko did you run their associated tests and ensure we have test coverage where we need it?
@omiroshnichenko did you run their associated tests and ensure we have test coverage where we need it?
Yes
@omiroshnichenko we should also update the TypeScript definition to include the new option: https://github.com/nk-o/jarallax/blob/master/typings/index.d.ts
@omiroshnichenko we should also update the TypeScript definition to include the new option: https://github.com/nk-o/jarallax/blob/master/typings/index.d.ts
Done.
Hey.
Thank you for contribution. I have checked your code a little and I have some questions:
oldElementData
? Users may set option and will be able to add unlimited different containers on one page and your code will not work with it.updateElementParallax
, which is called every tick, which is ok, but you call another function getParentBySelector
, it will go over all parent elements every single tick. I see you already checked it on the initialization step, so you will not need to check it again.updateParallax
, but create a copy of it? jarallaxList
is important part, which contains all parallax blocks.Maybe we can make something better, that can detect scrollable parents automatically? Something like this does Popper.js plugin. Example:
Hey.
Thank you for contribution. I have checked your code a little and I have some questions:
- Why do you limit it for a single
oldElementData
? Users may set option and will be able to add unlimited different containers on one page and your code will not work with it.- I see you added function
updateElementParallax
, which is called every tick, which is ok, but you call another functiongetParentBySelector
, it will go over all parent elements every single tick. I see you already checked it on the initialization step, so you will not need to check it again.- Why do you not use
updateParallax
, but create a copy of it?jarallaxList
is important part, which contains all parallax blocks.What about more complex situations like deep scrollable blocks? For example:
Scrollable Window
Scrollable Div
Another Scrollable Div
- Jarallax
Maybe we can make something better, that can detect scrollable parents automatically? Something like this does Popper.js plugin. Example:
containerList
has been introduced to store all containers that include jarallax instances in container and scroll positionupdateParallax
was updated.Auto detecting of a scrollable parent has been implemented.
Fixes #85