geosigno / simpleParallax.js

Easy Parallax Effect for React & JavaScript
https://simpleparallax.com
MIT License
1.82k stars 140 forks source link

Works intermittently on Chrome #45

Closed IOIIOOIO closed 4 years ago

IOIIOOIO commented 4 years ago

Works fine in Firefox but sometimes in Chrome it initialises fine but nothing happens when you scroll.

If I inspect element I can see that the translate3d doesn't change on scroll.

I am not getting any errors in the console.

I am using the most simple code:

 let images = document.getElementsByClassName('js-parallax');
new simpleParallax(images);

SimpleParallax version: 5.4.0 Chrome version: 81.0.4044.122

IOIIOOIO commented 4 years ago

I have resolved this by wrapping the init in a setTimeout. It's still early in the project so I haven't implemented critical CSS or anything like that.

So I suspect it's initialising while the page is still parsing the CSS and laying out the page etc

geosigno commented 4 years ago

You shouldn't need a timeout to make it works, can you share your project so i can have a look?

GuilleCabrera-dev commented 4 years ago

Hi, i have a similar problem in a new project, the images do not move scrolling the page, but they do, if your change window size a little. This is the code i'm using:

The project is: http://amaiagorostiza.com/

I apreciate your comments. Thanks

geosigno commented 4 years ago

There was an issue with lazy loaded images. this has been fixed with 5.4.1.

Let me know, thanks!

GuilleCabrera-dev commented 4 years ago

Hi, i found that the reason of my problem was a conflict with Smush plugin in Wordpress, it was affecting other parts of the page as too. So your plugin was not causing of the problem. Thanks for the quick answer!

geosigno commented 4 years ago

I think it should work even with the Smush plugin with the 5.4.1 version.

IOIIOOIO commented 4 years ago

Hi, I apologise for the late reply. It was a project in development so I wasn't allowed to share it due to Non-Disclosure Agreement.

I will update to 5.4.1 and let you know how it goes. I'm using native lazy-loading so that may be part of the problem.

IOIIOOIO commented 4 years ago

It seems to be working fine now, thanks!

Out of interest, you can view the site here:

https://fylmer.tv/

Thanks again, I really appreciated this plugin. It saves me so much time!

viren90 commented 3 years ago

Hi geosigno,

But still for me it is not working without adding setTimeout() we are using image lazy loading in AEM & it is creating a issue. could you please let me know anything else we need to do.

"simple-parallax-js": "^5.6.2",