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
Slides not 100% Width #89
Comments
It looks like you managed it by yourself. For future, probably script run before necessary DOM was ready, so wrong width calculation was performed. |
Hello, actually, i cheated, i used an iframe :(. I didn't get it to work directly on the page. And for your suggestion, like I said, i don't know javascript, so i really don't know what that means. |
Hi, I had the same problem and my janky solution vas:
|
I'm having this same problem where the slides are being created with a width which should be 100%, but is 30px out which throws the slides way out. As soon as I resize the window the issue resolves itself. Any pointers as to how I can get glide to load correctly in the first place or trigger a resize event so it sorts itself? |
I'm also having the same problem, is there an actual solution other than a timeout? |
This comment has been minimized.
This comment has been minimized.
@andershagbard, thanks for the reply. I'm using it in a React application, so it's getting mounted in the componentDidMount method, the DOM has already loaded so I'm a little confused as to why its not working, works fine with a settimeout so maybe I'll just use this solution! |
I actually ran info this issue myself. Thought my previous eventListener would fix it, but it didn't. This code seems to make it consistent. Initially on page load, it will show the slider with the incorrect fix, but it will fix it when readyState is complete. const api = new Glide(carousel, settings).mount();
if (document.readyState !== 'complete') {
document.addEventListener('readystatechange', () => {
if (document.readyState === 'complete') {
api.update();
}
});
} |
My really quick and dirty fix. Works pretty well for me. new Glide('.glide').mount()
document.querySelector('body').style.width = '99vw'
document.querySelector('body').style.width = '100vw' |
I'm also having the same problem, i use for my light box image |
I had this issue, too when the slide is inside a css flex column, which is again inside a grid area. To fix it I had to set .glide {
max-width: 100%;
} for the wrapper element |
@johannesmutter Thanks, your solution save my life)))) |
+1 I have the same issue with a slider where each slide contains one big image larger than the slider container (but displayed with With a slider that make 100% width of the screen, everything is fine. Resizing the windows put things in order. The |
It's now 2023 and I'm genuinely disappointed that worked 😄 |
Hello! This topic has kind of been answered here (#71), but since i don't really know javascript, i didn't understand exactly how and where to put the .reinit() code.
Here is where i am having the issue: http://helenaswax.com/2015/
As you can see, the slides are stacking to the left, but as soon as you change the browser window size, it adjusts perfectly. Could you help me with that?
Thanks in advance!
The text was updated successfully, but these errors were encountered: