jparallax icon indicating copy to clipboard operation
jparallax copied to clipboard

Problem when mouse enter the first time into the parallax or on first mouse move

Open marcocostantino opened this issue 9 years ago • 4 comments

Hi,

here's the example live, when mouse enter the first time the parallax block flickers, how can we solve?

Thank you again

The LINk where to see: http://h2osoft.it/ Parallax Version 1.1 jQuery 1.11.0

marcocostantino avatar May 08 '15 14:05 marcocostantino

I have the same problem. I guess it needed to be triggered somehow manually

mainpart avatar Sep 02 '15 03:09 mainpart

Any solution to this one?

sethkrasnianski avatar Nov 06 '15 20:11 sethkrasnianski

Alright guys, I think I got this figured out! It wasn't easy (actually it was a bit painful due to the lack of code comments) but I reverse engineered this and figured out how to initialize each layer on page load so that it's starting at the correct origin (from the middle, for example) and then gravitates to the correct position as you move your mouse over the defined viewport (a.k.a. mouse port).

See my proof of concept/PR here: https://github.com/stephband/jparallax/pull/89

patricknelson avatar May 10 '16 03:05 patricknelson

I also identified another issue with initialization where it will not actually properly render the parallax effect if your mouse happens to already be over the viewport upon initial page load. I've updated my PR to reflect that as well (could be buggy).

patricknelson avatar May 10 '16 03:05 patricknelson