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

Only working after resize #120

Open
jan-heise opened this issue Apr 17, 2023 · 8 comments
Open

Only working after resize #120

jan-heise opened this issue Apr 17, 2023 · 8 comments

Comments

@jan-heise
Copy link

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
Copy link

Having same issue. Any update here??

@CbDprogram
Copy link

Same issue, here any solution yet?

@Noahmorrow078
Copy link

same issue

@webdesignweisshart
Copy link

Same here

@geosigno
Copy link
Owner

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

@webdesignweisshart
Copy link

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:

<script type="module"> import SimpleParallax from "/js/simpleParallax.js-6.0.0/src/vanilla/index.js"; const image = document.getElementsByClassName('parallax'); new simpleParallax(image); </script>

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
Copy link
Owner

You can use one of the two links provided by jsdelivery: https://cdn.jsdelivr.net/npm/[email protected]/dist/vanilla/

@lear2000
Copy link

lear2000 commented Aug 27, 2024

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'));
});

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

No branches or pull requests

7 participants