geosigno / simpleParallax.js

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

Only working after resize #120

Open jan-heise opened 1 year ago

jan-heise commented 1 year ago

The Parallax-Effect only triggers after a windows resize in the current Chrome-Version - Is there anything we can do about it? We already tried to refresh the instance after the initialization but that doesnt help.

himali-hulkapps commented 1 year ago

Having same issue. Any update here??

CbDprogram commented 8 months ago

Same issue, here any solution yet?

Noahmorrow078 commented 7 months ago

same issue

webdesignweisshart commented 4 months ago

Same here

geosigno commented 3 months ago

I guess there was issue with the onload event of the image. Can you still reproduce the issue with the 6.0.0?

webdesignweisshart commented 3 months ago

How can I install SP 6.0.0 other than using npm? I uploaded the whole dir to my server, and called SP in vanilla Javascript:

But I get errors: Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

I would be grateful for any help

geosigno commented 3 months ago

You can use one of the two links provided by jsdelivery: https://cdn.jsdelivr.net/npm/simple-parallax-js@6.0.0/dist/vanilla/

lear2000 commented 1 month ago

im not good that great at js but got it working with this

document.addEventListener('DOMContentLoaded', function() {
    var images = document.querySelectorAll('.your-image-class');
    new simpleParallax(images);

    // Force refresh to ensure proper initialization
    window.dispatchEvent(new Event('resize'));
});