Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari bug #40

Open
petermcreaper opened this issue Jan 20, 2017 · 12 comments
Open

Safari bug #40

petermcreaper opened this issue Jan 20, 2017 · 12 comments
Labels

Comments

@petermcreaper
Copy link

In Safari (currently 10.0.2), the initial rellax element positions are incorrectly calculated unless a height is specified on the preceding containers/divs. Consequently, the 3d transforms are centered around a co-ordinate that is too far down the page. The more content is placed before the rellax element, the greater the error in the initial position. Testing in Chrome, the initial positions are calculated correctly.

I'm using the centering option var rellax = new Rellax('.rellax', {center: true});

Any ideas would be much appreciated.

@moeamaya moeamaya assigned moeamaya and unassigned moeamaya Jan 21, 2017
@moeamaya
Copy link
Member

Thx for the bug Pete. Most of this code was written by @p-realinho so let me check with him if there's an obvious solution

@p-realinho
Copy link
Contributor

Hi. I could take a look at the code, but I have no way to test this in Safari :/

@petermcreaper
Copy link
Author

Thanks @moeamaya @p-realinho.

Attached is a screengrab of the issue in chrome vs safari. The rellax element is the yellow shard in the background. You can see the transform is quite far off in safari at the same page position (+1060px vs -30px).

If there's any way I can help to isolate the issue please let me know.

screen shot 2017-01-22 at 16 00 42

@moeamaya moeamaya added the bug label Jan 25, 2017
@acki
Copy link

acki commented Feb 9, 2017

@moeamaya @Petemcd @p-realinho Only a nightly spontaneous idea:
Maybe in Safari rellax get a wrong reference point or the reference point delivers some bad values?
@Petemcd Can you share the test site with us in a Codepen or similar? Then i can help out with debugging.

@petermcreaper
Copy link
Author

petermcreaper commented Feb 14, 2017

Hi @acki, sorry about the delay. I think that might be the issue.

Here's a link to the test site (still needs some polishing 😅): http://terrydesign.co.uk/index.php/2017/index.html

@moeamaya
Copy link
Member

@Petemcd This is a super late reply and I know you've launched the site, but is this still an issue?

@matteightarms
Copy link

Also encountering this issue in safari @Petemcd did you find a workaround for this?

@MrUltimate
Copy link

I'm also having this issue. @Petemcd @matteightarms did you guys ever find a workaround?

@matteightarms
Copy link

@MrUltimate No I didn't sadly! Sorry.

@guidoschmidt
Copy link

We recently experienced that issue, too. What solved it for us was using an Intersection Observer on all of the .rellax classes and call rellax.refresh() once the element is seen by the Observer (and then unobserve the element again). Feels like a rather nasty fix but worked out quite well.

@moeamaya
Copy link
Member

@MrUltimate @matteightarms @guidoschmidt Happy to accept a PR that addresses this. Unfortunately just too preoccupied with family and the day job at the moment.

@guidoschmidt
Copy link

I've tried to understand the code of rellax.js a bit today. Really not sure, but it appears to me, that browsers differ in their way of returning getBoundingClientRect().top depending on their document loading lifecycle. See #180

Would be nice if someone could validate my suspicion and test is. I've also created a small test setup here: guidoschmidt/rellax.js.bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants